1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

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.
This commit is contained in:
Mark Stacey 2019-11-10 21:15:50 -05:00 committed by GitHub
parent 42279c474b
commit 66187333b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}
})
}