aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-09-27 05:15:16 +0800
committerDan Finlay <dan@danfinlay.com>2017-09-27 05:15:16 +0800
commit2eca5455c0c80d99b10c7d56858f84e605494fba (patch)
tree0b000122339107497b3f1523f026eaa4762ebb1d /app/scripts/controllers
parent3bedcd3582519c7afbb8164b40acca4b96eab4bf (diff)
downloadtangerine-wallet-browser-2eca5455c0c80d99b10c7d56858f84e605494fba.tar
tangerine-wallet-browser-2eca5455c0c80d99b10c7d56858f84e605494fba.tar.gz
tangerine-wallet-browser-2eca5455c0c80d99b10c7d56858f84e605494fba.tar.bz2
tangerine-wallet-browser-2eca5455c0c80d99b10c7d56858f84e605494fba.tar.lz
tangerine-wallet-browser-2eca5455c0c80d99b10c7d56858f84e605494fba.tar.xz
tangerine-wallet-browser-2eca5455c0c80d99b10c7d56858f84e605494fba.tar.zst
tangerine-wallet-browser-2eca5455c0c80d99b10c7d56858f84e605494fba.zip
Move obs store into account-tracker instead of inheriting
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r--app/scripts/controllers/balance.js4
-rw-r--r--app/scripts/controllers/computed-balances.js6
2 files changed, 5 insertions, 5 deletions
diff --git a/app/scripts/controllers/balance.js b/app/scripts/controllers/balance.js
index ab0cfe907..964dff0df 100644
--- a/app/scripts/controllers/balance.js
+++ b/app/scripts/controllers/balance.js
@@ -36,12 +36,12 @@ class BalanceController {
this.txController.on('submitted', update)
this.txController.on('confirmed', update)
this.txController.on('failed', update)
- this.accountTracker.subscribe(update)
+ this.accountTracker.store.subscribe(update)
this.blockTracker.on('block', update)
}
async _getBalance () {
- const { accounts } = this.accountTracker.getState()
+ const { accounts } = this.accountTracker.store.getState()
const entry = accounts[this.address]
const balance = entry.balance
return balance ? new BN(balance.substring(2), 16) : undefined
diff --git a/app/scripts/controllers/computed-balances.js b/app/scripts/controllers/computed-balances.js
index 2b27d128d..2479e1b3a 100644
--- a/app/scripts/controllers/computed-balances.js
+++ b/app/scripts/controllers/computed-balances.js
@@ -20,15 +20,15 @@ class ComputedbalancesController {
}
updateAllBalances () {
- for (let address in this.balances) {
+ for (let address in this.accountTracker.store.getState().accounts) {
this.balances[address].updateBalance()
}
}
_initBalanceUpdating () {
- const store = this.accountTracker.getState()
+ const store = this.accountTracker.store.getState()
this.addAnyAccountsFromStore(store)
- this.accountTracker.subscribe(this.addAnyAccountsFromStore.bind(this))
+ this.accountTracker.store.subscribe(this.addAnyAccountsFromStore.bind(this))
}
addAnyAccountsFromStore(store) {