mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
faster perceived loading
This commit is contained in:
parent
5f2253a02f
commit
823281f967
|
@ -143,8 +143,8 @@ class App extends Component<{}, AppState> {
|
||||||
// Provide the Ocean
|
// Provide the Ocean
|
||||||
//
|
//
|
||||||
this.setState({ message: 'Connecting to Ocean...' })
|
this.setState({ message: 'Connecting to Ocean...' })
|
||||||
|
const { ocean } = await provideOcean(web3provider)
|
||||||
const { ocean } = await provideOcean(this.state.web3)
|
this.setState({ ocean, isLoading: false })
|
||||||
|
|
||||||
// Get accounts
|
// Get accounts
|
||||||
const accounts = await ocean.accounts.list()
|
const accounts = await ocean.accounts.list()
|
||||||
|
@ -153,10 +153,8 @@ class App extends Component<{}, AppState> {
|
||||||
const balance = await accounts[0].getBalance()
|
const balance = await accounts[0].getBalance()
|
||||||
this.setState({
|
this.setState({
|
||||||
isLogged: true,
|
isLogged: true,
|
||||||
ocean,
|
|
||||||
balance,
|
balance,
|
||||||
account: accounts[0].getId(),
|
account: accounts[0].getId()
|
||||||
isLoading: false
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -164,13 +162,14 @@ class App extends Component<{}, AppState> {
|
||||||
// No Web3 browser
|
// No Web3 browser
|
||||||
//
|
//
|
||||||
const { ocean } = await provideOcean(this.state.web3)
|
const { ocean } = await provideOcean(this.state.web3)
|
||||||
|
this.setState({ isLoading: false })
|
||||||
|
|
||||||
const network = await ocean.keeper.getNetworkName()
|
const network = await ocean.keeper.getNetworkName()
|
||||||
const isNile = network === 'Nile'
|
const isNile = network === 'Nile'
|
||||||
this.setState({
|
this.setState({
|
||||||
isNile,
|
isNile,
|
||||||
ocean,
|
ocean,
|
||||||
network,
|
network
|
||||||
isLoading: false
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user