From 0befec9d65a5ece9fb67d0bd051abd42ced25ea6 Mon Sep 17 00:00:00 2001 From: thecodrr Date: Wed, 3 Mar 2021 22:09:24 +0500 Subject: [PATCH] fix: handle password error seperately in sign up --- apps/web/src/components/dialogs/signupdialog.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/dialogs/signupdialog.js b/apps/web/src/components/dialogs/signupdialog.js index e18f5e061..2f960c389 100644 --- a/apps/web/src/components/dialogs/signupdialog.js +++ b/apps/web/src/components/dialogs/signupdialog.js @@ -10,6 +10,7 @@ const requiredValues = ["email", "password"]; function SignUpDialog(props) { const { onClose } = props; const [error, setError] = useState(); + const [passwordError, setPasswordError] = useState(); const isSigningIn = useStore((store) => store.isSigningIn); const signup = useStore((store) => store.signup); @@ -46,7 +47,7 @@ function SignUpDialog(props) { as="form" onSubmit={(e) => { e.preventDefault(); - if (error) { + if (passwordError) { setError("Please resolve all errors before continuing."); return; } @@ -92,7 +93,7 @@ function SignUpDialog(props) { type="password" autoComplete="new-password" validatePassword - onError={setError} + onError={setPasswordError} sx={{ mt: 1 }} /> {error && typeof error === "string" && (