Skip to content

Commit

Permalink
Fixes incorrect loading state when login form is invalid (no credenti…
Browse files Browse the repository at this point in the history
…als provided) (ohcnetwork#7011)

* Fix incorrect loading state when login form is invalid

* fix bugs
  • Loading branch information
rithviknishad authored Jan 12, 2024
1 parent e187977 commit dfe9923
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Components/Auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,14 @@ export const Login = (props: { forgot?: boolean }) => {

const handleSubmit = async (e: any) => {
e.preventDefault();

setLoading(true);
invalidateFiltersCache();

const validated = validateData();
if (!validated) return;

if (!validated) {
setLoading(false);
return;
}
const { res } = await signIn(validated);

setCaptcha(res?.status === 429);
setLoading(false);
};
Expand Down

0 comments on commit dfe9923

Please sign in to comment.