From 5613d7236297ea6d1c9a52ddb5fe04e09ed356a4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 2 Aug 2022 11:27:24 +0200 Subject: [PATCH] use detectNetwork instead of ready --- apps/remix-ide/src/app/tabs/abstract-provider.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/abstract-provider.tsx b/apps/remix-ide/src/app/tabs/abstract-provider.tsx index 31b1a4e317..ae923bd88b 100644 --- a/apps/remix-ide/src/app/tabs/abstract-provider.tsx +++ b/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