handle undefined network (#10560)

feature/default_network_editable
Brad Decker 4 years ago committed by GitHub
parent e42658b590
commit eef92d0d5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      ui/app/pages/send/send-content/add-recipient/ens-input.component.js

@ -72,10 +72,19 @@ export default class EnsInput extends Component {
} }
if (prevProps.network !== network) { if (prevProps.network !== network) {
const provider = global.ethereumProvider; if (getNetworkEnsSupport(network)) {
this.ens = new ENS({ provider, network }); const provider = global.ethereumProvider;
if (!newProvidedValue) { this.ens = new ENS({ provider, network });
newValue = input; 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;
} }
} }

Loading…
Cancel
Save