mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-07-22 08:48:34 +00:00
The per-second countdown was the only thing pulling useEffect into this component, in violation of the project rule (CLAUDE.md: avoid useEffect, prefer event handlers). The hook was driving a tick purely so we could show "Resend in 28s" / "27s" / ... — none of which is load-bearing. Replace it with a single setTimeout fired from the resend event handler that flips resendStatus from "cooldown" back to "idle" after 30 seconds. The button stays disabled with "Code sent — wait a moment" instead of showing a live countdown. Same blocking signal, no hook needed. While here, split the single status enum into verifyStatus + resendStatus so the verify button no longer wrongly disables during a resend cooldown (latent bug from the previous shape). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| error | ||
| verify-code | ||