diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-12-11 11:51:45 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-12-11 11:51:45 +0700 |
| commit | 0f84963214ee6dc5b5a44d945540826a66bec9e0 (patch) | |
| tree | 4011423ed5147059f40afa873f87e167202f5f79 /src/pages/pengajuan-tempo/index.jsx | |
| parent | cecccfaf318e0e7c52132cf1d04c90c0df745d14 (diff) | |
<iman> update pengajuan tempo
Diffstat (limited to 'src/pages/pengajuan-tempo/index.jsx')
| -rw-r--r-- | src/pages/pengajuan-tempo/index.jsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/pages/pengajuan-tempo/index.jsx b/src/pages/pengajuan-tempo/index.jsx index f0681663..d485c721 100644 --- a/src/pages/pengajuan-tempo/index.jsx +++ b/src/pages/pengajuan-tempo/index.jsx @@ -41,25 +41,26 @@ export default function TrackingOrder() { } else { setIsLoading(false); } - }, [auth]); - + }, []); useEffect(() => { if (!auth) { const nextUrl = encodeURIComponent(router.asPath); router.push(`/login?next=${nextUrl}`); - } else if (!auth.parentId) { - router.push('/pengajuan-tempo/switch-account'); - } else if (auth.tempoProgres === 'review' && !tempo?.paymentTerm) { - router.push('/pengajuan-tempo/review'); } else if ( auth.tempoProgres === 'approve' && tempo?.paymentTerm?.toLowerCase().includes('tempo') ) { router.push('/pengajuan-tempo/approve'); + } else if (!auth.parentId) { + router.push('/pengajuan-tempo/switch-account'); + } else if (auth.tempoProgres === 'review' && !tempo?.paymentTerm) { + router.push('/pengajuan-tempo/review'); } else if (auth.tempoProgres === 'rejected') { router.push('/pengajuan-tempo/rejected'); + } else { + setIsLoading(false); } - }, [auth, router, tempo]); + }, [tempo]); if (isLoading || !auth || !tempo) { return null; // Tidak render apa pun selama loading atau auth/tempo belum tersedia |
