diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2025-03-27 14:44:54 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2025-03-27 14:44:54 +0700 |
| commit | 969e193708e01ffb88c0d81d72d63dad200e0ef8 (patch) | |
| tree | 59c44292727bdfecb2970cb1d8130c53c0075653 /src/pages/my/tempo | |
| parent | f88f457fd1b91298ea8a7f9f396e49660a81e276 (diff) | |
| parent | d64f70fbc89e2cea6cbd95f5c3e3af437a3c2810 (diff) | |
Merge branch 'new-release' into feature/integrasi_biteship
# Conflicts:
# src/lib/address/components/EditAddress.jsx
Diffstat (limited to 'src/pages/my/tempo')
| -rw-r--r-- | src/pages/my/tempo/index.jsx | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx index 5fb9deba..6ca5c718 100644 --- a/src/pages/my/tempo/index.jsx +++ b/src/pages/my/tempo/index.jsx @@ -13,39 +13,41 @@ export default function MyTempo() { const router = useRouter(); const [isLoading, setIsLoading] = useState(true); useEffect(() => { + setIsLoading(true); if (!auth) { const nextUrl = encodeURIComponent(router.asPath); router.push(`/login?next=${nextUrl}`); - } - // else if ( - // (auth.tempoProgres === '' || auth.tempoProgres === 'rejected') && - // !auth.company - // ) { - // router.push('/pengajuan-tempo'); - // } - else { + } else { + if ( + !auth.partnerTempo && + (!auth.partnerTempo || auth.tempoProgres === 'review') + ) { + setIsLoading(true); + router.push('/pengajuan-tempo'); + } setIsLoading(false); } }, [auth]); - if (isLoading || !auth) { - return null; // Tidak render apa pun selama loading atau auth/tempo belum tersedia - } - return ( - <IsAuth> - <Seo title='Tempo - Indoteknik.com' /> + if (isLoading && !auth) { + return null; + } else { + return ( + <IsAuth> + <Seo title='Tempo - Indoteknik.com' /> - <MobileView> - <AppLayout title='Pembayaran Tempo'> - <InvoicesComponent /> - </AppLayout> - </MobileView> + <MobileView> + <AppLayout title='Pembayaran Tempo'> + <InvoicesComponent /> + </AppLayout> + </MobileView> - <DesktopView> - <BasicLayout> - <InvoicesComponent /> - </BasicLayout> - </DesktopView> - </IsAuth> - ); + <DesktopView> + <BasicLayout> + <InvoicesComponent /> + </BasicLayout> + </DesktopView> + </IsAuth> + ); + } } |
