Skip to content

Commit 2180e63

Browse files
committed
no actions during verification
Signed-off-by: d.phan <d.phan@salesforce.com>
1 parent 3df27b5 commit 2180e63

File tree

1 file changed

+5
-3
lines changed
  • packages/template-retail-react-app/app/components/otp-auth

1 file changed

+5
-3
lines changed

packages/template-retail-react-app/app/components/otp-auth/index.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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',

0 commit comments

Comments
 (0)