File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/template-retail-react-app/app/components/otp-auth Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ const OtpAuth = ({
102102 } , [ isOpen , resendCooldownDuration ] )
103103
104104 const handleVerify = async ( code = otpInputs . values . join ( '' ) ) => {
105- if ( code . length !== OTP_LENGTH ) return
105+ if ( isVerifying || code . length !== OTP_LENGTH ) return
106106
107107 setIsVerifying ( true )
108108 setError ( '' )
@@ -138,8 +138,8 @@ const OtpAuth = ({
138138 }
139139
140140 const handleResend = async ( ) => {
141- // Only send OTP when cooldown is complete ; button is always visible/enabled
142- if ( resendTimer > 0 ) return
141+ // No action while verifying or during cooldown ; button stays visible/enabled
142+ if ( isVerifying || resendTimer > 0 ) return
143143
144144 setResendTimer ( resendCooldownDuration )
145145 try {
@@ -161,6 +161,8 @@ const OtpAuth = ({
161161 }
162162
163163 const handleCheckoutAsGuest = async ( ) => {
164+ if ( isVerifying ) return
165+
164166 // Track checkout as guest selection
165167 await track ( '/checkout-as-guest' , {
166168 activity : 'checkout_as_guest_selected' ,
You can’t perform that action at this time.
0 commit comments