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});