From 7f28b2220f7a2c1a41c7d82d5943631b63942214 Mon Sep 17 00:00:00 2001 From: KimiaMontazeri Date: Mon, 27 Nov 2023 22:41:04 +0330 Subject: [PATCH] fix(signup): toast opening in each render --- frontend/src/pages/Signup/Signup.jsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/Signup/Signup.jsx b/frontend/src/pages/Signup/Signup.jsx index fec1317..556e49b 100644 --- a/frontend/src/pages/Signup/Signup.jsx +++ b/frontend/src/pages/Signup/Signup.jsx @@ -116,11 +116,10 @@ const SignUpForm = ({ onLoginClick }) => { toastDataTemp.alertType = 'error'; break; } + setAccessTokenFromLocalStorage(); + setToastData(toastDataTemp); + setOpenToast(true); } - - setAccessTokenFromLocalStorage(); - setToastData(toastDataTemp); - setOpenToast(true); }, [createUserData]); return (