use detectNetwork instead of ready

pull/2714/head^2
yann300 2 years ago committed by Aniket
parent c290556193
commit 5613d72362
  1. 3
      apps/remix-ide/src/app/tabs/abstract-provider.tsx

@ -101,7 +101,7 @@ export abstract class AbstractProvider extends Plugin {
reject('Unable to connect')
}
}, 2000)
await this.provider.ready
await this.provider.detectNetwork() // this throws if the network cannot be detected
this.connected = true
} catch (e) {
this.switchAway(true)
@ -116,6 +116,7 @@ export abstract class AbstractProvider extends Plugin {
}
private async switchAway (showError) {
if (!this.provider) return
this.provider = null
this.blocked = true
this.connected = false

Loading…
Cancel
Save