From 6ee387653d8db833f08b5595557565cabb4bc346 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 29 Jun 2018 18:00:21 -0400 Subject: [PATCH] fix metamask check for non dev environment --- lib/contracts/code_generator.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/contracts/code_generator.js b/lib/contracts/code_generator.js index dc8354301..d7943fa50 100644 --- a/lib/contracts/code_generator.js +++ b/lib/contracts/code_generator.js @@ -126,7 +126,6 @@ class CodeGenerator { result += plugin.generateProvider(self) + "\n"; }); } else { - let web3Load; if (isDeployment) { @@ -134,11 +133,8 @@ class CodeGenerator { web3Load = Templates.define_web3_simple({url: connection, done: 'done();'}); } else { let connectionList = "[" + this.contractsConfig.dappConnection.map((x) => '"' + x + '"').join(',') + "]"; - if (self.env === 'development') { - web3Load = Templates.web3_connector({connectionList: connectionList, done: 'done(err);', warnAboutMetamask: true}); - } else { - web3Load = Templates.web3_connector({connectionList: connectionList, done: 'done(err);', warnAboutMetamask: true}); - } + let isDev = (self.env === 'development'); + web3Load = Templates.web3_connector({connectionList: connectionList, done: 'done(err);', warnAboutMetamask: isDev}); } result += Templates.do_when_loaded({block: web3Load});