Preserve registration form while rechecking access
All checks were successful
Deploy production / deploy (push) Successful in 12m7s

This commit is contained in:
admin i 2026-11-03 18:38:31 +03:00
parent 6860bdba15
commit 70ce84c8a7
2 changed files with 12 additions and 2 deletions

View File

@ -307,7 +307,10 @@ export default function Register() {
}
};
if (registration.state !== "allowed") {
if (
registration.state !== "allowed" &&
!(registration.state === "loading" && registration.previouslyAllowed)
) {
return (
<RegistrationAccessNotice
state={registration.state}
@ -355,6 +358,12 @@ export default function Register() {
</div>
)}
{registration.state === "loading" && (
<p className="app-text-muted mb-4 text-sm" role="status">
Проверяем доступность регистрации…
</p>
)}
<form onSubmit={handleSubmit} className="space-y-6">
{/* Шаг 1: Личные данные */}
{currentStep === 1 && (
@ -710,7 +719,7 @@ export default function Register() {
<button
type="submit"
disabled={isLoading}
disabled={isLoading || registration.state !== "allowed"}
className="app-action-primary flex-1 rounded-lg px-4 py-3 text-sm font-semibold disabled:cursor-not-allowed disabled:opacity-50"
>
{isLoading ? (

View File

@ -53,6 +53,7 @@ export function useRegistrationAvailability() {
result?.generation === generation
? result.state
: ("loading" as RegistrationAvailability),
previouslyAllowed: result?.state === "allowed",
refresh,
};
}