fix loading issue and api error on empty response

This commit is contained in:
2026-05-11 21:21:21 +03:30
parent e32fb90296
commit 676f1373c1
4 changed files with 21 additions and 2 deletions

View File

@@ -62,6 +62,7 @@ export default function Home() {
if (result.success) {
// Redirect to verify page with mobile number
router.push(`/verify-code?mobile=${encodeURIComponent(normalizedMobile)}`)
return // Don't set loading to false — component will unmount
} else {
setError(result.message || 'خطا در ارسال کد')
}