From 2dc7f7ae3eb62f9821f8ae1fb87db2e7b9234e1b Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 1 Oct 2024 10:57:08 +0700
Subject: <iman> update logic switch account

---
 src/pages/my/profile.jsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/pages/my/profile.jsx')

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() {
       <IsAuth>
         <MobileView>
           <AppLayout title='Akun Saya'>
-            {!auth?.parentId && ubahAkun && (
+            {!auth?.parentId && !ubahAkun && (
               <div className='text-sm p-4 flex items-center'>
                 <Checkbox
                   borderColor='gray.600'
@@ -108,7 +108,7 @@ export default function Profile() {
                 <Menu />
               </div>
               <div className='w-9/12 bg-white border border-gray_r-6 rounded'>
-                {!auth?.parentId && ubahAkun && (
+                {!auth?.parentId && !ubahAkun && (
                   <div className='text-sm p-4 flex items-center'>
                     <Checkbox
                       borderColor='gray.600'
-- 
cgit v1.2.3

