diff --git a/src/app/components/AuthPage/AuthPage.tsx b/src/app/components/AuthPage/AuthPage.tsx index 9f9e56d..573066d 100644 --- a/src/app/components/AuthPage/AuthPage.tsx +++ b/src/app/components/AuthPage/AuthPage.tsx @@ -17,10 +17,9 @@ export default function AuthPage ({children} : {children: React.ReactNode}) { const { userAgent, isMobile, isStandalone, isIOS } = useUserAgent(); useEffect(() => { - /* console.log("standalone in auth page " , isStandalone) */ - - if (window) { + /* Uncomment for auth */ + /* if (window) { console.log("window is here") if (window.matchMedia('(display-mode: standalone)').matches) { console.log('standalone') @@ -36,20 +35,8 @@ export default function AuthPage ({children} : {children: React.ReactNode}) { router.push('/'); } - } - - /* if (!isStandalone) { + } */ - router.push('/'); - } */ - /* if (authenticated && zeroDevReady) { - // route home - console.log('authenticated'); - router.push('/home'); - } else { - router.push('/login'); - } - */ diff --git a/src/app/components/Balance/Balance.tsx b/src/app/components/Balance/Balance.tsx index 347196b..670700f 100644 --- a/src/app/components/Balance/Balance.tsx +++ b/src/app/components/Balance/Balance.tsx @@ -6,17 +6,13 @@ import { useBalance } from 'wagmi'; import { RootState } from '../../../GlobalRedux/store'; import { useDispatch, useSelector } from 'react-redux'; import { setBalance } from '@/GlobalRedux/Features/balance/balanceSlice'; -// hooks -import useGetBalance from '@/app/hooks/useGetBalance'; // React import { useEffect } from 'react'; // next import { usePathname } from 'next/navigation'; -import useGetAddress from '@/app/hooks/useGetAddress'; -// react -import { useState } from 'react'; + export default function Balance() { // Redux const dispatch = useDispatch(); @@ -25,15 +21,17 @@ export default function Balance() { // hooks const address = useSelector((state: RootState) => state.address.value); - const result = useBalance({ - // @ts-ignore - address: address, - token: '0x94a9D9AC8a22534E3FaCa9F4e7F2E2cf85d5E4C8', - }); + const checkBalance = async () => { try { - console.log('result', result); + console.log('balance', result?.data?.formatted); + + const result = useBalance({ + // @ts-ignore + address: address, + token: '0x94a9D9AC8a22534E3FaCa9F4e7F2E2cf85d5E4C8', + }); // @ts-ignore dispatch(setBalance(result?.data?.formatted)); } catch (error) { @@ -45,11 +43,12 @@ export default function Balance() { useEffect(() => { console.log(`Route changed to: ${pathname}`); checkBalance(); - }, [pathname, result]); + }, [pathname]); // Get the balance from Redux const balanceState = useSelector((state: RootState) => state.balance.value); console.log('balanceState', balanceState); + // Render the balance return