1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Default to not showing unsupported network message when no wallet is connected

This commit is contained in:
Jamie Hewitt 2022-04-11 13:16:14 +03:00
parent bfba30fe9d
commit faf9be8d3a

View File

@ -110,7 +110,7 @@ function Web3Provider({ children }: { children: ReactNode }): ReactElement {
ocean: '0'
})
const [isSupportedOceanNetwork, setIsSupportedOceanNetwork] =
useState<boolean>()
useState<boolean>(true)
// -----------------------------------
// Helper: connect to web3
@ -316,10 +316,10 @@ function Web3Provider({ children }: { children: ReactNode }): ReactElement {
useEffect(() => {
if (appConfig.chainIdsSupported.includes(networkId)) {
setIsSupportedOceanNetwork(true)
} else {
} else if (accountId) {
setIsSupportedOceanNetwork(false)
}
}, [networkId, appConfig])
}, [accountId, networkId, appConfig])
// -----------------------------------
// Handle change events