From a33398f65c2403b51554e6b357746ba7840e234f Mon Sep 17 00:00:00 2001 From: XiNiHa Date: Wed, 11 Feb 2026 17:31:42 +0900 Subject: [PATCH 1/3] delay showing resend verification email button --- .../web/app/src/pages/auth-verify-email.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/web/app/src/pages/auth-verify-email.tsx b/packages/web/app/src/pages/auth-verify-email.tsx index dcb2312009a..9881d0547af 100644 --- a/packages/web/app/src/pages/auth-verify-email.tsx +++ b/packages/web/app/src/pages/auth-verify-email.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import { useSessionContext } from 'supertokens-auth-react/recipe/session'; import { useMutation } from 'urql'; import { AuthCard, AuthCardContent, AuthCardHeader, AuthCardStack } from '@/components/auth'; @@ -42,12 +42,14 @@ function AuthVerifyEmail() { const session = useSessionContext(); const navigate = useNavigate(); - const [sendEmailMutation, sendEmailImpl] = useMutation(SendVerificationEmailMutation); + const [, sendEmailImpl] = useMutation(SendVerificationEmailMutation); const [verifyMutation, verify] = useMutation(VerifyEmailMutation); + const [resendDisabled, setResendDisabled] = useState(true); const sendEmail = useCallback( async (resend?: boolean) => { if (session.loading) return; + setResendDisabled(true); const result = await sendEmailImpl( { @@ -69,6 +71,7 @@ function AuthVerifyEmail() { title: 'Verification email sent', description: 'Please check your email inbox.', }); + await new Promise(resolve => setTimeout(resolve, 3000)); } else if (result.data?.sendVerificationEmail.error?.emailAlreadyVerified) { void navigate({ to: '/' }); } else { @@ -80,6 +83,8 @@ function AuthVerifyEmail() { 'An unknown error occurred.', }); } + + setResendDisabled(false); }, [session.loading, sendEmailImpl, toast], ); @@ -117,11 +122,7 @@ function AuthVerifyEmail() {

There was an unexpected error when verifying your email address.

-