Skip to content

Commit

Permalink
client: fix Signup's info tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham-Lal committed Jun 5, 2024
1 parent b006fa7 commit ae79b88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion client/src/components/modal/auth/brief-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ const BriefInfo: React.FC<RegisterDataProps> = ({ registerData, setRegisterData
toast.error(response.message)
}
})
.catch(() => setIsAuthenticated(AuthStatus.Failed));
.catch(() => setIsAuthenticated(AuthStatus.Failed))
.catch(() => setIsSubmitted(false));
}
};

Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/auth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ export default function AuthPage() {
const location = useLocation();
const navigate = useNavigate();
const { route, isAuthenticated, setAuthTab } = useAuthStore();
const { setTempUser } = useTempStore();
const { tempUser, setTempUser } = useTempStore();

useEffect(() => {
const params = new URLSearchParams(location.search);
const type = params.get('type');

if (isAuthenticated === AuthStatus.Authenticating) {
setAuthTab(type === 'login' ? AuthTab.Login : type === 'signup' ? AuthTab.Signup : AuthTab.Login);
setAuthTab(type === 'login' ? AuthTab.Login : type === 'signup' ? tempUser ? AuthTab.Info : AuthTab.Signup : AuthTab.Login);
}
else if (isAuthenticated === AuthStatus.Authenticated) {
navigate(route === '/auth' || route === '/login' || route === '/signup' ? '/' : route, { replace: true });
Expand Down

0 comments on commit ae79b88

Please sign in to comment.