fix ModalRegistration

This commit is contained in:
Никита Губарь 2024-01-09 20:13:51 +03:00
parent 4b0176079e
commit 0764002a60
2 changed files with 8 additions and 3 deletions

View File

@ -129,12 +129,14 @@ export const ModalRegistration = ({ active, setActive }) => {
<Loader style={"green"} />
) : (
<BaseButton
onClick={(e) => {
onClick={async (e) => {
e.preventDefault();
setLoader(true);
handleSubmit(e);
setLoader(false);
const result = await handleSubmit(e);
if (result === true) {
closeModal();
}
setLoader(false);
}}
styles="button-box__submit"
>

View File

@ -102,6 +102,9 @@ export const useFormValidation = (
} catch (error) {
console.error("Error submitting form:", error);
}
return true;
} else {
return false;
}
};