mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
handle undefined network (#10560)
This commit is contained in:
parent
e42658b590
commit
eef92d0d5a
@ -72,11 +72,20 @@ export default class EnsInput extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (prevProps.network !== network) {
|
if (prevProps.network !== network) {
|
||||||
|
if (getNetworkEnsSupport(network)) {
|
||||||
const provider = global.ethereumProvider;
|
const provider = global.ethereumProvider;
|
||||||
this.ens = new ENS({ provider, network });
|
this.ens = new ENS({ provider, network });
|
||||||
|
this.checkName = debounce(this.lookupEnsName, 200);
|
||||||
if (!newProvidedValue) {
|
if (!newProvidedValue) {
|
||||||
newValue = input;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newValue !== undefined) {
|
if (newValue !== undefined) {
|
||||||
|
Loading…
Reference in New Issue
Block a user