Skip to content

Commit

Permalink
Merge pull request #327 from RootstockCollective/DAO-805/error-messag…
Browse files Browse the repository at this point in the history
…e-proposal

fix: error message on proposal creation not properly displayed
  • Loading branch information
jessgusclark authored Oct 30, 2024
2 parents 6d0e09f + 9da504c commit fcb892b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/components/MainContainer/MainContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -25,7 +25,6 @@ export const MainContainer: FC<Props> = ({ children, notProtected = false }) =>
const { message, setMessage } = useAlertContext()
const router = useRouter()
const modal = useModal()
const pathname = usePathname()

const [hasMounted, setHasMounted] = useState(false)

Expand All @@ -34,13 +33,6 @@ export const MainContainer: FC<Props> = ({ 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
Expand Down

0 comments on commit fcb892b

Please sign in to comment.