Preserve registration form while rechecking access
All checks were successful
Deploy production / deploy (push) Successful in 12m7s
All checks were successful
Deploy production / deploy (push) Successful in 12m7s
This commit is contained in:
parent
6860bdba15
commit
70ce84c8a7
@ -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 ? (
|
||||
|
||||
@ -53,6 +53,7 @@ export function useRegistrationAvailability() {
|
||||
result?.generation === generation
|
||||
? result.state
|
||||
: ("loading" as RegistrationAvailability),
|
||||
previouslyAllowed: result?.state === "allowed",
|
||||
refresh,
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user