From f0f002ff77481db91d264069d09f580d58001a8c Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 23 Sep 2024 13:15:02 +0700 Subject: update switch account --- src/pages/my/profile.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/pages') diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index 4beaae5f..13cab06d 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -16,6 +16,7 @@ import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js'; export default function Profile() { const auth = useAuth(); const [isChecked, setIsChecked] = useState(false); + const [ubahAkun, setUbahAkun] = useState(false); const [isAprove, setIsAprove] = useState('unknown'); const handleChange = async () => { setIsChecked(!isChecked); @@ -25,6 +26,7 @@ export default function Profile() { const progresSwitchAccount = await switchAccountProgresApi(); if (progresSwitchAccount) { setIsAprove(progresSwitchAccount.status); + setUbahAkun(progresSwitchAccount.status === 'unknown'); } console.log('progresSwitchAccount', progresSwitchAccount); }; @@ -48,7 +50,7 @@ export default function Profile() {
- {!auth?.parentId && isAprove == 'unknown' && ( + {!auth?.parentId && ubahAkun && (