aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-09-26 02:42:08 +0800
committerDan Finlay <dan@danfinlay.com>2017-09-26 02:42:08 +0800
commit40f1d0868401662c42f6a031549c9b023427ccef (patch)
tree800bdc8ad96cee0b9c72148322c22f9dbd57036f /app
parentf128240e7f877280fa59bf22f2ea8285bb467022 (diff)
downloadtangerine-wallet-browser-40f1d0868401662c42f6a031549c9b023427ccef.tar
tangerine-wallet-browser-40f1d0868401662c42f6a031549c9b023427ccef.tar.gz
tangerine-wallet-browser-40f1d0868401662c42f6a031549c9b023427ccef.tar.bz2
tangerine-wallet-browser-40f1d0868401662c42f6a031549c9b023427ccef.tar.lz
tangerine-wallet-browser-40f1d0868401662c42f6a031549c9b023427ccef.tar.xz
tangerine-wallet-browser-40f1d0868401662c42f6a031549c9b023427ccef.tar.zst
tangerine-wallet-browser-40f1d0868401662c42f6a031549c9b023427ccef.zip
Made some requested changes
Diffstat (limited to 'app')
-rw-r--r--app/scripts/controllers/balance.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/scripts/controllers/balance.js b/app/scripts/controllers/balance.js
index ddeb06cf9..840b7abc3 100644
--- a/app/scripts/controllers/balance.js
+++ b/app/scripts/controllers/balance.js
@@ -16,7 +16,7 @@ class BalanceController {
this.store = new ObservableStore(initState)
this.balanceCalc = new PendingBalanceCalculator({
- getBalance: () => Promise.resolve(this._getBalance()),
+ getBalance: () => this._getBalance(),
getPendingTransactions: this._getPendingTransactions.bind(this),
})
@@ -35,24 +35,24 @@ class BalanceController {
this.txController.on('submitted', update)
this.txController.on('confirmed', update)
this.txController.on('failed', update)
+ this.accountTracker.subscribe(update)
this.txController.blockTracker.on('block', update)
}
- _getBalance () {
- const store = this.accountTracker.getState()
- const balances = store.accounts
- const entry = balances[this.address]
+ async _getBalance () {
+ const { accounts } = this.accountTracker.getState()
+ const entry = accounts[this.address]
const balance = entry.balance
return balance ? new BN(balance.substring(2), 16) : undefined
}
- _getPendingTransactions () {
+ async _getPendingTransactions () {
const pending = this.txController.getFilteredTxList({
from: this.address,
status: 'submitted',
err: undefined,
})
- return Promise.resolve(pending)
+ return pending
}
}