update balance only if necessary

pull/5370/head
yann300 5 years ago
parent c278347fd8
commit 2c70dd30ca
  1. 5
      apps/remix-ide/src/app/tabs/runTab/settings.js

@ -46,7 +46,10 @@ class SettingsUI {
accounts.each((index, account) => {
this.blockchain.getBalanceInEther(account.value, (err, balance) => {
if (err) return
account.innerText = helper.shortenAddress(account.value, balance)
const updated = helper.shortenAddress(account.value, balance)
if (updated !== account.innerText) { // check if the balance has been updated and update UI accordingly.
account.innerText = updated
}
})
})
}

Loading…
Cancel
Save