Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-1464] fix: infinite loader on the sign-up and sign-in when redirection from different routes #4856

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion web/core/components/account/auth-forms/email.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { FC, FormEvent, useMemo, useState } from "react";
import { FC, FormEvent, useEffect, useMemo, useState } from "react";
import { observer } from "mobx-react-lite";
// icons
import { CircleAlert, XCircle } from "lucide-react";
Expand Down Expand Up @@ -41,6 +41,8 @@ export const AuthEmailForm: FC<TAuthEmailForm> = observer((props) => {

const isButtonDisabled = email.length === 0 || Boolean(emailError?.email) || isSubmitting;

useEffect(() => () => setIsSubmitting(false), []);

return (
<form onSubmit={handleFormSubmit} className="mt-5 space-y-4">
<div className="space-y-1">
Expand Down
1 change: 1 addition & 0 deletions web/core/components/account/auth-forms/password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const AuthPasswordForm: React.FC<Props> = observer((props: Props) => {
useEffect(() => {
if (csrfToken === undefined)
authService.requestCSRFToken().then((data) => data?.csrf_token && setCsrfToken(data.csrf_token));
return () => setIsSubmitting(false);
}, [csrfToken]);

const redirectToUniqueCodeSignIn = async () => {
Expand Down
1 change: 1 addition & 0 deletions web/core/components/account/auth-forms/unique-code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const AuthUniqueCodeForm: React.FC<TAuthUniqueCodeForm> = (props) => {
useEffect(() => {
if (csrfToken === undefined)
authService.requestCSRFToken().then((data) => data?.csrf_token && setCsrfToken(data.csrf_token));
return () => setIsSubmitting(false);
}, [csrfToken]);

const isRequestNewCodeDisabled = isRequestingNewCode || resendTimerCode > 0;
Expand Down
Loading