Commit 9cd4a3aa authored by Iuri Matias's avatar Iuri Matias

refactor context and endPointUrl vars

parent 8022b16b
...@@ -784,13 +784,11 @@ function run () { ...@@ -784,13 +784,11 @@ function run () {
runCompiler() runCompiler()
if (queryParams.get().context) { 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?', () => { 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) { if (!endPointUrl) {
endPointUrl = 'http://localhost:8545' endPointUrl = 'http://localhost:8545'
} }
......
...@@ -247,16 +247,11 @@ function runTab (container, appAPI, appEvents, opts) { ...@@ -247,16 +247,11 @@ function runTab (container, appAPI, appEvents, opts) {
} }
selectExEnv.addEventListener('change', function (event) { 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?', () => { modalDialogCustom.confirm(null, 'Are you sure you want to connect to an ethereum node?', () => {
let endPointUrl = null; modalDialogCustom.prompt(null, 'Web3 Provider Endpoint', 'http://localhost:8545', (target) => {
let context = selectExEnv.options[selectExEnv.selectedIndex].value;
if (!endPointUrl) {
endPointUrl = 'http://localhost:8545'
}
modalDialogCustom.prompt(null, 'Web3 Provider Endpoint', endPointUrl, (target) => {
executionContext.setProviderFromEndpoint(target, context, setFinalContext) executionContext.setProviderFromEndpoint(target, context, setFinalContext)
}, setFinalContext) }, setFinalContext)
}, setFinalContext) }, setFinalContext)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment