From 2dc7f7ae3eb62f9821f8ae1fb87db2e7b9234e1b Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 1 Oct 2024 10:57:08 +0700 Subject: update logic switch account --- src/lib/auth/components/SwitchAccount.jsx | 4 ++-- src/pages/my/profile.jsx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/auth/components/SwitchAccount.jsx b/src/lib/auth/components/SwitchAccount.jsx index a609d9e7..12d00890 100644 --- a/src/lib/auth/components/SwitchAccount.jsx +++ b/src/lib/auth/components/SwitchAccount.jsx @@ -233,11 +233,11 @@ const SwitchAccount = ({ company_type }) => { buttonSubmitClick={buttonSubmitClick} />
-
+
diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index ee0cd907..f44a44f3 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -18,7 +18,7 @@ export default function Profile() { const auth = useAuth(); const [isChecked, setIsChecked] = useState(false); const [ubahAkun, setUbahAkun] = useState(false); - const [isAprove, setIsAprove] = useState('unknown'); + const [isAprove, setIsAprove] = useState(); const [changeConfirmation, setChangeConfirmation] = useState(false); const handleChange = async () => { if (isChecked) { @@ -32,7 +32,7 @@ export default function Profile() { const progresSwitchAccount = await switchAccountProgresApi(); if (progresSwitchAccount) { setIsAprove(progresSwitchAccount.status); - setUbahAkun(progresSwitchAccount.status === 'unknown'); + setUbahAkun(progresSwitchAccount.status); } }; loadPromo(); @@ -71,7 +71,7 @@ export default function Profile() { - {!auth?.parentId && ubahAkun && ( + {!auth?.parentId && !ubahAkun && (
- {!auth?.parentId && ubahAkun && ( + {!auth?.parentId && !ubahAkun && (