diff --git a/src/app.js b/src/app.js index 9c22c1bb0c..86c2cd041c 100644 --- a/src/app.js +++ b/src/app.js @@ -784,13 +784,11 @@ function run () { runCompiler() if (queryParams.get().context) { - executionContext.setContext(queryParams.get().context, queryParams.get().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?', () => { - let context = queryParams.get().context; - let endPointUrl = queryParams.get().endPointUrl; - if (!endPointUrl) { endPointUrl = 'http://localhost:8545' } diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 789f150c4b..f66cbf943d 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -247,16 +247,11 @@ function runTab (container, appAPI, appEvents, opts) { } selectExEnv.addEventListener('change', function (event) { - executionContext.executionContextChange(selectExEnv.options[selectExEnv.selectedIndex].value, null, () => { + 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?', () => { - let endPointUrl = null; - let context = selectExEnv.options[selectExEnv.selectedIndex].value; - - if (!endPointUrl) { - endPointUrl = 'http://localhost:8545' - } - modalDialogCustom.prompt(null, 'Web3 Provider Endpoint', endPointUrl, (target) => { + modalDialogCustom.prompt(null, 'Web3 Provider Endpoint', 'http://localhost:8545', (target) => { executionContext.setProviderFromEndpoint(target, context, setFinalContext) }, setFinalContext) }, setFinalContext)