Skip to content

Commit

Permalink
Merge pull request #832 from Zafeeruddin/feature/ToasterLoader
Browse files Browse the repository at this point in the history
Feature/toaster loader
  • Loading branch information
siinghd authored Jul 28, 2024
2 parents 4b15073 + 7d5a70f commit 4e33525
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/Signin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const Signin = () => {
const password = useRef('');

const handleSubmit = async (e?: React.FormEvent<HTMLButtonElement>) => {
const loadId = toast.loading('Signing in...');
if (e) {
e.preventDefault();
}
Expand All @@ -33,6 +34,7 @@ const Signin = () => {
emailReq: email.current ? false : true,
passReq: password.current ? false : true,
});
toast.dismiss(loadId);
return;
}
setCheckingPassword(true);
Expand All @@ -42,6 +44,7 @@ const Signin = () => {
redirect: false,
});

toast.dismiss(loadId);
if (!res?.error) {
router.push('/');
toast.success('Signed In');
Expand Down

0 comments on commit 4e33525

Please sign in to comment.