Skip to content

Commit 242b599

Browse files
committed
fix(verify): clear lingering message on complete OTP (restore parity)
1 parent e693edd commit 242b599

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

apps/sim/app/(auth)/verify/use-verification.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,14 @@ export function useVerification({
187187
})
188188
}
189189

190+
/**
191+
* On a complete (6-char) code, clear any lingering message — including a
192+
* resend failure (which sets `errorMessage` while `status` stays `idle`) — and
193+
* exit the error state, matching the prior unconditional reset on a full OTP.
194+
*/
190195
function handleOtpChange(value: string) {
191-
if (value.length === 6 && status === 'error') {
192-
setStatus('idle')
196+
if (value.length === 6) {
197+
if (status === 'error') setStatus('idle')
193198
setErrorMessage('')
194199
}
195200
setOtp(value)

0 commit comments

Comments
 (0)