refactor context and endPointUrl vars

pull/1/head
Iuri Matias 7 years ago
parent 8022b16b55
commit 9cd4a3aa1d
  1. 8
      src/app.js
  2. 11
      src/app/tabs/run-tab.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'
}

@ -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)

Loading…
Cancel
Save