Commit 71fb6a12 authored by yann300's avatar yann300

update balance only if necessary

parent d92d3078
...@@ -46,7 +46,10 @@ class SettingsUI { ...@@ -46,7 +46,10 @@ class SettingsUI {
accounts.each((index, account) => { accounts.each((index, account) => {
this.blockchain.getBalanceInEther(account.value, (err, balance) => { this.blockchain.getBalanceInEther(account.value, (err, balance) => {
if (err) return 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
}
}) })
}) })
} }
......
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