disable ens if it is not enabled

This commit is contained in:
Jonathan Rainville 2018-08-03 08:50:42 -04:00 committed by Iuri Matias
parent 4408afaf40
commit 73c2ee887d
1 changed files with 7 additions and 8 deletions

View File

@ -14,6 +14,13 @@ class ENS {
this.registration = this.namesConfig.register || {}; this.registration = this.namesConfig.register || {};
this.embark = embark; this.embark = embark;
if (this.namesConfig === {} ||
this.namesConfig.enabled !== true ||
this.namesConfig.available_providers.indexOf('ens') < 0 ||
this.namesConfig.provider !== 'ens') {
return;
}
this.addENSToEmbarkJS(); this.addENSToEmbarkJS();
this.configureContracts(); this.configureContracts();
this.registerEvents(); this.registerEvents();
@ -179,14 +186,6 @@ class ENS {
addENSToEmbarkJS() { addENSToEmbarkJS() {
const self = this; const self = this;
// TODO: make this a shouldAdd condition
if (this.namesConfig === {}) {
return;
}
if ((this.namesConfig.available_providers.indexOf('ens') < 0) && (this.namesConfig.provider !== 'ens' || this.namesConfig.enabled !== true)) {
return;
}
// get namehash, import it into file // get namehash, import it into file
self.events.request("version:get:eth-ens-namehash", function (EnsNamehashVersion) { self.events.request("version:get:eth-ens-namehash", function (EnsNamehashVersion) {