mirror of
https://github.com/oceanprotocol/react.git
synced 2025-02-14 21:10:38 +01:00
format
This commit is contained in:
parent
16ab666952
commit
100903d10b
@ -55,7 +55,7 @@ function App() {
|
||||
return (
|
||||
<OceanProvider initialConfig={configRinkeby} web3ModalOpts={web3ModalOpts}>
|
||||
<div className="container">
|
||||
<NetworkMonitor/>
|
||||
<NetworkMonitor />
|
||||
<div>
|
||||
<Wallet />
|
||||
</div>
|
||||
|
@ -4,26 +4,22 @@ import { ConfigHelper } from '@oceanprotocol/lib'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export function NetworkMonitor() {
|
||||
const { connect, web3Provider } = useOcean()
|
||||
const { connect, web3Provider } = useOcean()
|
||||
|
||||
const handleNetworkChanged = () => {
|
||||
// const config = getOceanConfig(chainId)
|
||||
const config = new ConfigHelper().getConfig('rinkeby')
|
||||
connect(config)
|
||||
const handleNetworkChanged = () => {
|
||||
// const config = getOceanConfig(chainId)
|
||||
const config = new ConfigHelper().getConfig('rinkeby')
|
||||
connect(config)
|
||||
}
|
||||
useEffect(() => {
|
||||
if (!web3Provider) return
|
||||
|
||||
web3Provider.on('chainChanged', handleNetworkChanged)
|
||||
|
||||
return () => {
|
||||
web3Provider.removeListener('chainChanged', handleNetworkChanged)
|
||||
}
|
||||
useEffect(() => {
|
||||
}, [web3Provider])
|
||||
|
||||
if (!web3Provider) return
|
||||
|
||||
web3Provider.on('chainChanged', handleNetworkChanged)
|
||||
|
||||
return () => {
|
||||
web3Provider.removeListener('chainChanged', handleNetworkChanged)
|
||||
}
|
||||
}, [web3Provider])
|
||||
|
||||
return (
|
||||
<>
|
||||
</>
|
||||
)
|
||||
return <></>
|
||||
}
|
||||
|
@ -173,7 +173,6 @@ function OceanProvider({
|
||||
logout,
|
||||
refreshBalance
|
||||
} as OceanProviderValue
|
||||
|
||||
}
|
||||
>
|
||||
{children}
|
||||
|
Loading…
x
Reference in New Issue
Block a user