summaryrefslogtreecommitdiff
path: root/src/pages/my
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-09-23 13:15:02 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-09-23 13:15:02 +0700
commitf0f002ff77481db91d264069d09f580d58001a8c (patch)
treecb3b916a1688c17407d1a831e36c12c6021feac3 /src/pages/my
parentc13bb5c6f78032695b24cf8a6c23942eb465c6d5 (diff)
<iman> update switch account
Diffstat (limited to 'src/pages/my')
-rw-r--r--src/pages/my/profile.jsx4
1 files changed, 3 insertions, 1 deletions
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() {
<Menu />
</div>
<div className='w-9/12 bg-white border border-gray_r-6 rounded'>
- {!auth?.parentId && isAprove == 'unknown' && (
+ {!auth?.parentId && ubahAkun && (
<div className='text-sm p-4 flex items-center'>
<Checkbox
borderColor='gray.600'