mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
unknown account fix
This commit is contained in:
parent
a249302a42
commit
006d292a91
19
src/App.tsx
19
src/App.tsx
@ -70,12 +70,19 @@ class App extends Component<{}, AppState> {
|
|||||||
} else {
|
} else {
|
||||||
if (accounts.length === 0 && window.ethereum) {
|
if (accounts.length === 0 && window.ethereum) {
|
||||||
await window.ethereum.enable()
|
await window.ethereum.enable()
|
||||||
this.setState({
|
const newAccounts = await web3.eth.getAccounts()
|
||||||
isLogged: true,
|
if (accounts.length > 0) {
|
||||||
isWeb3: true,
|
this.setState({
|
||||||
account: accounts[0],
|
isLogged: true,
|
||||||
web3
|
isWeb3: true,
|
||||||
})
|
account: newAccounts[0],
|
||||||
|
web3
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// failed to unlock
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// no unlock procedure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user