Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Commit

Permalink
get chainId as early as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
kremalicious committed Jul 20, 2020
1 parent 941ca71 commit c5a273e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/providers/OceanProvider/OceanProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ function OceanProvider({
const web3 = new Web3(provider)
setWeb3(web3)

const chainId = web3 && (await web3.eth.getChainId())
setChainId(chainId)
Logger.log('chain id ', chainId)

config.web3Provider = web3
const ocean = await Ocean.getInstance(config)

Expand All @@ -103,10 +107,6 @@ function OceanProvider({
const balance = await getBalance(account)
setBalance(balance)
Logger.log('balance', JSON.stringify(balance))

const chainId = web3 && (await web3.eth.getChainId())
setChainId(chainId)
Logger.log('chain id ', chainId)
}

async function logout() {
Expand Down

0 comments on commit c5a273e

Please sign in to comment.