fix loading issue and api error on empty response
This commit is contained in:
@@ -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 || 'خطا در ارسال کد')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user