aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/transaction-manager.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/transaction-manager.js')
-rw-r--r--app/scripts/transaction-manager.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/scripts/transaction-manager.js b/app/scripts/transaction-manager.js
index 8d4cf6df3..6299091f2 100644
--- a/app/scripts/transaction-manager.js
+++ b/app/scripts/transaction-manager.js
@@ -17,9 +17,8 @@ module.exports = class TransactionManager extends EventEmitter {
}, opts.initState))
this.memStore = new ObservableStore({})
this.networkStore = opts.networkStore || new ObservableStore({})
-
+ this.preferencesStore = opts.preferencesStore || new ObservableStore({})
this.txHistoryLimit = opts.txHistoryLimit
- this.getSelectedAddress = opts.getSelectedAddress
this.provider = opts.provider
this.blockTracker = opts.blockTracker
this.txProviderUtils = new TxProviderUtil(this.provider)
@@ -27,10 +26,11 @@ module.exports = class TransactionManager extends EventEmitter {
this.signEthTx = opts.signTransaction
this.nonceLock = Semaphore(1)
- // memstore is computed from diskStore
+ // memstore is computed from a few different stores
this._updateMemstore()
this.store.subscribe(() => this._updateMemstore() )
this.networkStore.subscribe(() => this._updateMemstore() )
+ this.preferencesStore.subscribe(() => this._updateMemstore() )
}
getState () {
@@ -41,6 +41,10 @@ module.exports = class TransactionManager extends EventEmitter {
return this.networkStore.getState().network
}
+ getSelectedAddress () {
+ return this.preferencesStore.getState().selectedAddress
+ }
+
// Returns the tx list
getTxList () {
let network = this.getNetwork()