Skip to content

Commit

Permalink
fix 310 error (i hope) (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
juancwu authored Dec 9, 2024
2 parents c78ef20 + 5610300 commit fe9ffb6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/pages/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
);

Expand Down Expand Up @@ -268,7 +270,7 @@ const Register = () => {

document.removeEventListener('visibilitychange', handleVisibilityChange);
};
}, [formData.email]);
}, [email, setCurrentStep]);

return (
<div className="w-full max-w-md mx-auto p-6 bg-white rounded-lg">
Expand Down

0 comments on commit fe9ffb6

Please sign in to comment.