Commit ad7b647d authored by Noah Zinsmeister's avatar Noah Zinsmeister

clear stale network error

parent 70e9257c
...@@ -173,12 +173,16 @@ export default function Web3Status() { ...@@ -173,12 +173,16 @@ export default function Web3Status() {
// if calling enable won't pop an approve modal, then try to activate injected... // if calling enable won't pop an approve modal, then try to activate injected...
library.listAccounts().then(accounts => { library.listAccounts().then(accounts => {
if (accounts.length >= 1) { if (accounts.length >= 1) {
setConnector('Injected', { suppressAndThrowErrors: true }).catch(error => { setConnector('Injected', { suppressAndThrowErrors: true })
// ...and if the error is that they're on the wrong network, display it, otherwise eat it .then(() => {
if (error.code === Connector.errorCodes.UNSUPPORTED_NETWORK) { setError()
setError(error) })
} .catch(error => {
}) // ...and if the error is that they're on the wrong network, display it, otherwise eat it
if (error.code === Connector.errorCodes.UNSUPPORTED_NETWORK) {
setError(error)
}
})
} }
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment