update account balance less often

pull/3094/head
yann300 7 years ago
parent 12c4cf6b7d
commit 728a5cfc56
  1. 7
      src/app/tabs/run-tab.js

@ -215,7 +215,7 @@ function runTab (container, appAPI, appEvents, opts) {
var el = yo` var el = yo`
<div class="${css.runTabView}" id="runTabView"> <div class="${css.runTabView}" id="runTabView">
${settings(appAPI, appEvents)} ${settings(container, appAPI, appEvents)}
${contractDropdown(events, appAPI, appEvents, instanceContainer)} ${contractDropdown(events, appAPI, appEvents, instanceContainer)}
${pendingTxsContainer} ${pendingTxsContainer}
${instanceContainer} ${instanceContainer}
@ -244,7 +244,7 @@ function runTab (container, appAPI, appEvents, opts) {
setInterval(() => { setInterval(() => {
updateAccountBalances(container, appAPI) updateAccountBalances(container, appAPI)
updatePendingTxs(container, appAPI) updatePendingTxs(container, appAPI)
}, 500) }, 10000)
events.register('clearInstance', () => { events.register('clearInstance', () => {
instanceContainer.innerHTML = '' // clear the instances list instanceContainer.innerHTML = '' // clear the instances list
@ -497,7 +497,7 @@ function contractDropdown (events, appAPI, appEvents, instanceContainer) {
/* ------------------------------------------------ /* ------------------------------------------------
section SETTINGS: Environment, Account, Gas, Value section SETTINGS: Environment, Account, Gas, Value
------------------------------------------------ */ ------------------------------------------------ */
function settings (appAPI, appEvents) { function settings (container, appAPI, appEvents) {
// SETTINGS HTML // SETTINGS HTML
var net = yo`<span class=${css.network}></span>` var net = yo`<span class=${css.network}></span>`
const updateNetwork = () => { const updateNetwork = () => {
@ -573,6 +573,7 @@ function settings (appAPI, appEvents) {
appEvents.udapp.register('transactionExecuted', (error, from, to, data, lookupOnly, txResult) => { appEvents.udapp.register('transactionExecuted', (error, from, to, data, lookupOnly, txResult) => {
if (error) return if (error) return
if (!lookupOnly) el.querySelector('#value').value = '0' if (!lookupOnly) el.querySelector('#value').value = '0'
updateAccountBalances(container, appAPI)
}) })
return el return el

Loading…
Cancel
Save