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"} /> <Loader style={"green"} />
) : ( ) : (
<BaseButton <BaseButton
onClick={(e) => { onClick={async (e) => {
e.preventDefault(); e.preventDefault();
setLoader(true); setLoader(true);
handleSubmit(e); const result = await handleSubmit(e);
setLoader(false); if (result === true) {
closeModal(); closeModal();
}
setLoader(false);
}} }}
styles="button-box__submit" styles="button-box__submit"
> >

View File

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