From 66187333b134d1bb818586bb4432bcb86cc93209 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Sun, 10 Nov 2019 21:15:50 -0500 Subject: [PATCH] Prevent attempting ENS resolution on unsupported networks (#7378) The check for whether the network is supported was performed in the constructor, but it was accidentally omitted from the network change handler. --- app/scripts/controllers/ens/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/scripts/controllers/ens/index.js b/app/scripts/controllers/ens/index.js index 6456f8b53..8451ccb65 100644 --- a/app/scripts/controllers/ens/index.js +++ b/app/scripts/controllers/ens/index.js @@ -26,10 +26,14 @@ class EnsController { this.store = new ObservableStore(initState) networkStore.subscribe((network) => { this.store.putState(initState) - this._ens = new Ens({ - network, - provider, - }) + if (Ens.getNetworkEnsSupport(network)) { + this._ens = new Ens({ + network, + provider, + }) + } else { + delete this._ens + } }) }