From 5b03403b4afa98319a8d5e4d993ef9a74953980c Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 2 Feb 2018 10:03:44 -0500 Subject: [PATCH] lint is king --- src/app.js | 19 +++++++++---------- src/app/tabs/run-tab.js | 22 ++++++++++------------ src/execution-context.js | 6 +++--- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/app.js b/src/app.js index 86c2cd041c..73f2c21cd8 100644 --- a/src/app.js +++ b/src/app.js @@ -784,19 +784,18 @@ function run () { runCompiler() if (queryParams.get().context) { - let context = queryParams.get().context; - let endPointUrl = queryParams.get().endPointUrl; - executionContext.setContext(context, endpointurl, + let context = queryParams.get().context + let endPointUrl = queryParams.get().endPointUrl + executionContext.setContext(context, endPointUrl, () => { modalDialogCustom.confirm(null, 'Are you sure you want to connect to an ethereum node?', () => { - if (!endPointUrl) { - endPointUrl = 'http://localhost:8545' - } - modalDialogCustom.prompt(null, 'Web3 Provider Endpoint', endPointUrl, (target) => { - executionContext.setProviderFromEndpoint(target, context) - }, () => {}) + if (!endPointUrl) { + endPointUrl = 'http://localhost:8545' + } + modalDialogCustom.prompt(null, 'Web3 Provider Endpoint', endPointUrl, (target) => { + executionContext.setProviderFromEndpoint(target, context) }, () => {}) - + }, () => {}) }, (alertMsg) => { modalDialogCustom.alert(alertMsg) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 04bef97669..ee2837f0e9 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -239,7 +239,7 @@ function runTab (container, appAPI, appEvents, opts) { // DROPDOWN var selectExEnv = el.querySelector('#selectExEnvOptions') - function setFinalContext() { + function setFinalContext () { // set the final context. Cause it is possible that this is not the one we've originaly selected selectExEnv.value = executionContext.getProvider() fillAccountsList(appAPI, el) @@ -247,20 +247,18 @@ function runTab (container, appAPI, appEvents, opts) { } selectExEnv.addEventListener('change', function (event) { - let context = selectExEnv.options[selectExEnv.selectedIndex].value; + let context = selectExEnv.options[selectExEnv.selectedIndex].value executionContext.executionContextChange(context, null, () => { - modalDialogCustom.confirm(null, 'Are you sure you want to connect to an ethereum node?', () => { - modalDialogCustom.prompt(null, 'Web3 Provider Endpoint', 'http://localhost:8545', (target) => { - executionContext.setProviderFromEndpoint(target, context, (alertMsg) => { - if (alertMsg) { - modalDialogCustom.alert(alertMsg) - } - setFinalContext() - }) - }, setFinalContext) + modalDialogCustom.prompt(null, 'Web3 Provider Endpoint', 'http://localhost:8545', (target) => { + executionContext.setProviderFromEndpoint(target, context, (alertMsg) => { + if (alertMsg) { + modalDialogCustom.alert(alertMsg) + } + setFinalContext() + }) }, setFinalContext) - + }, setFinalContext) }, (alertMsg) => { modalDialogCustom.alert(alertMsg) }, setFinalContext) diff --git a/src/execution-context.js b/src/execution-context.js index 3b23ce9919..c4e77bdba6 100644 --- a/src/execution-context.js +++ b/src/execution-context.js @@ -166,7 +166,7 @@ function ExecutionContext () { var alertMsg = 'No injected Web3 provider found. ' alertMsg += 'Make sure your provider (e.g. MetaMask) is active and running ' alertMsg += '(when recently activated you may have to reload the page).' - infoCb(alertMsg); + infoCb(alertMsg) return cb() } else { executionContext = context @@ -177,7 +177,7 @@ function ExecutionContext () { } if (context === 'web3') { - confirmCb(cb); + confirmCb(cb) } } @@ -221,7 +221,7 @@ function ExecutionContext () { cb(alertMsg) } } - this.setProviderFromEndpoint = setProviderFromEndpoint; + this.setProviderFromEndpoint = setProviderFromEndpoint } module.exports = new ExecutionContext()