summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-02-25 13:46:10 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-02-25 13:46:10 +0700
commit6c4fe7aec3aec0879fd0880cffe02263b4655f29 (patch)
treebd7ee174bd252b0a85798b315ca57a6e00de8c47 /src
parentdf5d4208209d0d4a92ecf1183dfd8a83ec35383f (diff)
parent95322b2c473da6160af0e3d685ec3d5eb924df05 (diff)
Merge branch 'new-release' into CR/Renca-voucher
# Conflicts: # src/pages/my/tempo/index.jsx
Diffstat (limited to 'src')
-rw-r--r--src/pages/my/tempo/index.jsx45
1 files changed, 25 insertions, 20 deletions
diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx
index 0c6fc0fb..6ca5c718 100644
--- a/src/pages/my/tempo/index.jsx
+++ b/src/pages/my/tempo/index.jsx
@@ -13,36 +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.partnerTempo && (!auth.partnerTempo || auth.tempoProgres === 'review') ) {
+ 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>
+ );
+ }
}