From 73c2ee887dda4c96bdf4e38480fc5692f44ab7ea Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 3 Aug 2018 08:50:42 -0400 Subject: [PATCH] disable ens if it is not enabled --- lib/modules/ens/index.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/modules/ens/index.js b/lib/modules/ens/index.js index c51a86ac..3ac8443b 100644 --- a/lib/modules/ens/index.js +++ b/lib/modules/ens/index.js @@ -14,6 +14,13 @@ class ENS { this.registration = this.namesConfig.register || {}; 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.configureContracts(); this.registerEvents(); @@ -179,14 +186,6 @@ class ENS { addENSToEmbarkJS() { 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 self.events.request("version:get:eth-ens-namehash", function (EnsNamehashVersion) {