1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

handle undefined network (#10560)

This commit is contained in:
Brad Decker 2021-03-02 18:20:37 -06:00
parent 9d97dcb22e
commit 615f87e12e

View File

@ -72,10 +72,19 @@ export default class EnsInput extends Component {
}
if (prevProps.network !== network) {
const provider = global.ethereumProvider;
this.ens = new ENS({ provider, network });
if (!newProvidedValue) {
newValue = input;
if (getNetworkEnsSupport(network)) {
const provider = global.ethereumProvider;
this.ens = new ENS({ provider, network });
this.checkName = debounce(this.lookupEnsName, 200);
if (!newProvidedValue) {
newValue = input;
}
} else {
// ens is null on mount on a network that does not have ens support
// this is intended to prevent accidental lookup of domains across
// networks
this.ens = null;
this.checkName = null;
}
}