Skip to content

Commit

Permalink
Check if the message is 'Unsupported message' and if not then clear t…
Browse files Browse the repository at this point in the history
…he message.
  • Loading branch information
jessgusclark committed Oct 29, 2024
1 parent 8d3f31f commit be1448e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/MainContainer/MainContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ export const MainContainer: FC<Props> = ({ children, notProtected = false }) =>
}

useEffect(() => {
// Clear message on route change
setMessage(null)
}, [pathname, setMessage])
// 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
Expand Down

0 comments on commit be1448e

Please sign in to comment.