From f3e668c0f40d11a276c28398fc3feb099055916c Mon Sep 17 00:00:00 2001 From: Aidan Traboulay Date: Mon, 9 Dec 2024 16:56:53 -0400 Subject: [PATCH] fix 310 error --- frontend/src/pages/Register.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Register.tsx b/frontend/src/pages/Register.tsx index ffa416e..f796f0e 100644 --- a/frontend/src/pages/Register.tsx +++ b/frontend/src/pages/Register.tsx @@ -216,13 +216,15 @@ const Register = () => { ); const renderVerifyEmail = () => { + const email = formData.email; + useEffect(() => { let isMounted = true; const checkVerification = async () => { try { const response = await fetch( - getApiUrl(`/auth/ami-verified?email=${encodeURIComponent(formData.email)}`), + getApiUrl(`/auth/ami-verified?email=${encodeURIComponent(email)}`), { method: 'GET' } ); @@ -268,7 +270,7 @@ const Register = () => { document.removeEventListener('visibilitychange', handleVisibilityChange); }; - }, [formData.email]); + }, [email, setCurrentStep]); return (