From 9a33f3a391a402807cc5e7913b1a97e430a7aaa2 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Tue, 15 Aug 2023 15:16:38 +0700
Subject: sign in

---
 src/core/components/layouts/BasicLayout.jsx | 87 +++++++++++++----------------
 1 file changed, 38 insertions(+), 49 deletions(-)

(limited to 'src/core/components/layouts/BasicLayout.jsx')

diff --git a/src/core/components/layouts/BasicLayout.jsx b/src/core/components/layouts/BasicLayout.jsx
index e8f6434b..e5c6908a 100644
--- a/src/core/components/layouts/BasicLayout.jsx
+++ b/src/core/components/layouts/BasicLayout.jsx
@@ -18,26 +18,20 @@ const AnimationLayout = dynamic(() => import('./AnimationLayout'))
 const BasicLayout = ({ children }) => {
   const [templateWA, setTemplateWA] = useState(null)
   const [payloadWA, setPayloadWa] = useState(null)
-  const [isLoading, setIsloading] = useState(false)
 
   const router = useRouter()
   const { data: session } = useSession()
   const auth = getAuth()
   const setting = async () => {
-    if (!auth && session) {
-      setCookie('auth', JSON.stringify(session?.odooUser))
-      setIsloading(false)
-    }
+    setCookie('auth', JSON.stringify(session?.odooUser))
   }
 
   useEffect(() => {
-    setting()
-  }, [session])
-
-  useEffect(() => {
-    setting()
+    // if (!auth && session) {
+    //   setting()
+    // }
+    console.log('ini auth', auth)
     console.log('ini session', session)
-    console.log('ini auth', getAuth())
     const getIP = async () => {
       const ip = await odooApi('GET', '/api/ip-address')
       const data = {
@@ -65,44 +59,39 @@ const BasicLayout = ({ children }) => {
       setTemplateWA('product')
     }
   }, [])
-  if(isLoading){
-
-  }else{
-    return (
-      <>
-        <Navbar />
-        <AnimationLayout>
-          {children}
-          <div className='fixed bottom-4 right-4 sm:bottom-14 sm:right-10 z-50'>
-            <a
-              href={whatsappUrl(templateWA, payloadWA)}
-              className='py-2 pl-3 pr-4 rounded-full bg-[#4FB84A] border border-green-300 flex items-center'
-              rel='noopener noreferrer'
-              target='_blank'
-            >
-              <Image
-                src='/images/socials/WHATSAPP.svg'
-                alt='Whatsapp'
-                className='block sm:hidden'
-                width={36}
-                height={36}
-              />
-              <Image
-                src='/images/socials/WHATSAPP.svg'
-                alt='Whatsapp'
-                className='hidden sm:block'
-                width={44}
-                height={44}
-              />
-              <span className='text-white font-bold ml-1.5'>Whatsapp</span>
-            </a>
-          </div>
-        </AnimationLayout>
-        <BasicFooter />
-      </>
-    )
-  }
-  
+  return (
+    <>
+      <Navbar />
+      <AnimationLayout>
+        {children}
+        <div className='fixed bottom-4 right-4 sm:bottom-14 sm:right-10 z-50'>
+          <a
+            href={whatsappUrl(templateWA, payloadWA)}
+            className='py-2 pl-3 pr-4 rounded-full bg-[#4FB84A] border border-green-300 flex items-center'
+            rel='noopener noreferrer'
+            target='_blank'
+          >
+            <Image
+              src='/images/socials/WHATSAPP.svg'
+              alt='Whatsapp'
+              className='block sm:hidden'
+              width={36}
+              height={36}
+            />
+            <Image
+              src='/images/socials/WHATSAPP.svg'
+              alt='Whatsapp'
+              className='hidden sm:block'
+              width={44}
+              height={44}
+            />
+            <span className='text-white font-bold ml-1.5'>Whatsapp</span>
+          </a>
+        </div>
+      </AnimationLayout>
+      <BasicFooter />
+    </>
+  )
 }
 
 export default BasicLayout
-- 
cgit v1.2.3

