mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
add isNile check
This commit is contained in:
parent
50cafa5c72
commit
09281aa8e3
@ -31,6 +31,7 @@ interface AppState {
|
|||||||
isLogged: boolean
|
isLogged: boolean
|
||||||
isLoading: boolean
|
isLoading: boolean
|
||||||
isWeb3: boolean
|
isWeb3: boolean
|
||||||
|
isNile: boolean
|
||||||
account: string
|
account: string
|
||||||
balance: {
|
balance: {
|
||||||
eth: number
|
eth: number
|
||||||
@ -82,6 +83,7 @@ class App extends Component<{}, AppState> {
|
|||||||
isLogged: false,
|
isLogged: false,
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
isWeb3: false,
|
isWeb3: false,
|
||||||
|
isNile: false,
|
||||||
balance: {
|
balance: {
|
||||||
eth: 0,
|
eth: 0,
|
||||||
ocn: 0
|
ocn: 0
|
||||||
@ -167,7 +169,8 @@ class App extends Component<{}, AppState> {
|
|||||||
const accounts = await ocean.accounts.list()
|
const accounts = await ocean.accounts.list()
|
||||||
const balance = await accounts[0].getBalance()
|
const balance = await accounts[0].getBalance()
|
||||||
const network = await ocean.keeper.getNetworkName()
|
const network = await ocean.keeper.getNetworkName()
|
||||||
this.setState({ balance, network })
|
const isNile = network === 'Nile'
|
||||||
|
this.setState({ balance, network, isNile })
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Logger.log('ocean/balance error', e)
|
Logger.log('ocean/balance error', e)
|
||||||
this.setState({
|
this.setState({
|
||||||
|
Loading…
Reference in New Issue
Block a user