Commit f47657db authored by lianahus's avatar lianahus Committed by Liana Husikyan

refactored

parent 101feb4e
......@@ -394,11 +394,15 @@ class SettingsUI {
this.accountListCallId++
const callid = this.accountListCallId
const txOrigin = this.el.querySelector('#txorigin')
let accounts = []
try {
let accounts = await this.blockchain.getAccounts()
accounts = await this.blockchain.getAccounts()
} catch (e) {
addTooltip(`Cannot get account list: ${e}`)
}
if (!accounts) accounts = []
if (this.accountListCallId > callid) return
this.accountListCallId++
if (!accounts) accounts = []
for (var loadedaddress in this.loadedAccounts) {
if (accounts.indexOf(loadedaddress) === -1) {
txOrigin.removeChild(txOrigin.querySelector('option[value="' + loadedaddress + '"]'))
......@@ -413,9 +417,6 @@ class SettingsUI {
}
}
txOrigin.setAttribute('value', accounts[0])
} catch (e) {
addTooltip(`Cannot get account list: ${e}`)
}
}
}
......
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