diff --git a/src/components/MainContainer/MainContainer.tsx b/src/components/MainContainer/MainContainer.tsx index 3a9adedb..b7514084 100644 --- a/src/components/MainContainer/MainContainer.tsx +++ b/src/components/MainContainer/MainContainer.tsx @@ -5,7 +5,7 @@ import { Footer } from '@/components/Footer' import { ConnectButton, Header } from '@/components/Header' import { StatefulSidebar } from '@/components/MainContainer/StatefulSidebar' import { shortAddress } from '@/lib/utils' -import { usePathname, useRouter } from 'next/navigation' +import { useRouter } from 'next/navigation' import { FC, ReactNode, useEffect, useState } from 'react' import { useAccount, useDisconnect } from 'wagmi' import { Alert } from '../Alert' @@ -25,7 +25,6 @@ export const MainContainer: FC = ({ children, notProtected = false }) => const { message, setMessage } = useAlertContext() const router = useRouter() const modal = useModal() - const pathname = usePathname() const [hasMounted, setHasMounted] = useState(false) @@ -34,13 +33,6 @@ export const MainContainer: FC = ({ children, notProtected = false }) => disconnect() } - useEffect(() => { - // Clear message on route change unless it is Unsupported network - if (message && message.title !== 'Unsupported network') { - setMessage(null) - } - }, [pathname, message, setMessage]) - useEffect(() => { // This is to prevent Hydration error on client side // because useAccount hook is not available on server side