lint is king

pull/1/head
Iuri Matias 7 years ago
parent 5a2a9a1a34
commit 5b03403b4a
  1. 19
      src/app.js
  2. 22
      src/app/tabs/run-tab.js
  3. 6
      src/execution-context.js

@ -784,19 +784,18 @@ function run () {
runCompiler() runCompiler()
if (queryParams.get().context) { if (queryParams.get().context) {
let context = queryParams.get().context; let context = queryParams.get().context
let endPointUrl = queryParams.get().endPointUrl; let endPointUrl = queryParams.get().endPointUrl
executionContext.setContext(context, 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?', () => {
if (!endPointUrl) { if (!endPointUrl) {
endPointUrl = 'http://localhost:8545' endPointUrl = 'http://localhost:8545'
} }
modalDialogCustom.prompt(null, 'Web3 Provider Endpoint', endPointUrl, (target) => { modalDialogCustom.prompt(null, 'Web3 Provider Endpoint', endPointUrl, (target) => {
executionContext.setProviderFromEndpoint(target, context) executionContext.setProviderFromEndpoint(target, context)
}, () => {})
}, () => {}) }, () => {})
}, () => {})
}, },
(alertMsg) => { (alertMsg) => {
modalDialogCustom.alert(alertMsg) modalDialogCustom.alert(alertMsg)

@ -239,7 +239,7 @@ function runTab (container, appAPI, appEvents, opts) {
// DROPDOWN // DROPDOWN
var selectExEnv = el.querySelector('#selectExEnvOptions') 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 // set the final context. Cause it is possible that this is not the one we've originaly selected
selectExEnv.value = executionContext.getProvider() selectExEnv.value = executionContext.getProvider()
fillAccountsList(appAPI, el) fillAccountsList(appAPI, el)
@ -247,20 +247,18 @@ function runTab (container, appAPI, appEvents, opts) {
} }
selectExEnv.addEventListener('change', function (event) { selectExEnv.addEventListener('change', function (event) {
let context = selectExEnv.options[selectExEnv.selectedIndex].value; let context = selectExEnv.options[selectExEnv.selectedIndex].value
executionContext.executionContextChange(context, null, () => { 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?', () => {
modalDialogCustom.prompt(null, 'Web3 Provider Endpoint', 'http://localhost:8545', (target) => { modalDialogCustom.prompt(null, 'Web3 Provider Endpoint', 'http://localhost:8545', (target) => {
executionContext.setProviderFromEndpoint(target, context, (alertMsg) => { executionContext.setProviderFromEndpoint(target, context, (alertMsg) => {
if (alertMsg) { if (alertMsg) {
modalDialogCustom.alert(alertMsg) modalDialogCustom.alert(alertMsg)
} }
setFinalContext() setFinalContext()
}) })
}, setFinalContext)
}, setFinalContext) }, setFinalContext)
}, setFinalContext)
}, (alertMsg) => { }, (alertMsg) => {
modalDialogCustom.alert(alertMsg) modalDialogCustom.alert(alertMsg)
}, setFinalContext) }, setFinalContext)

@ -166,7 +166,7 @@ function ExecutionContext () {
var alertMsg = 'No injected Web3 provider found. ' var alertMsg = 'No injected Web3 provider found. '
alertMsg += 'Make sure your provider (e.g. MetaMask) is active and running ' alertMsg += 'Make sure your provider (e.g. MetaMask) is active and running '
alertMsg += '(when recently activated you may have to reload the page).' alertMsg += '(when recently activated you may have to reload the page).'
infoCb(alertMsg); infoCb(alertMsg)
return cb() return cb()
} else { } else {
executionContext = context executionContext = context
@ -177,7 +177,7 @@ function ExecutionContext () {
} }
if (context === 'web3') { if (context === 'web3') {
confirmCb(cb); confirmCb(cb)
} }
} }
@ -221,7 +221,7 @@ function ExecutionContext () {
cb(alertMsg) cb(alertMsg)
} }
} }
this.setProviderFromEndpoint = setProviderFromEndpoint; this.setProviderFromEndpoint = setProviderFromEndpoint
} }
module.exports = new ExecutionContext() module.exports = new ExecutionContext()

Loading…
Cancel
Save