Skip to content

Commit

Permalink
fix: call hooks unconditionally
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Prodromou <evan@openearth.org>
  • Loading branch information
evanp committed Aug 14, 2023
1 parent 7016468 commit a59a004
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions app/src/app/[lng]/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ type Inputs = {
function VerifiedNotification({ t }: { t: TFunction }) {
const searchParams = useSearchParams();
const isVerified = !!searchParams.get('verification-code');

if (isVerified) {
const toast = useToast();
useEffect(() => {
const toast = useToast();
useEffect(() => {
if (isVerified) {
toast({
title: t('verified-toast-title'),
description: t('verified-toast-description'),
Expand All @@ -30,9 +29,8 @@ function VerifiedNotification({ t }: { t: TFunction }) {
isClosable: true,
position: 'bottom-right',
});
}, [])
}

}
}, [t, toast, isVerified]);
return null;
}

Expand Down Expand Up @@ -69,4 +67,3 @@ export default function Login({ params: { lng } }: { params: { lng: string } })
</>
);
}

0 comments on commit a59a004

Please sign in to comment.