aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-01-15 13:29:46 +0800
committerkumavis <aaron@kumavis.me>2017-01-15 13:29:46 +0800
commitf49fb149ccae56f5522a892778d83360856fe880 (patch)
tree921290cf70852c5b85c4e9f7a1862f87bbd3aae6 /app/scripts
parentc3d491a37cb4d704e405b1e19560c14dd2c401ae (diff)
downloadtangerine-wallet-browser-f49fb149ccae56f5522a892778d83360856fe880.tar
tangerine-wallet-browser-f49fb149ccae56f5522a892778d83360856fe880.tar.gz
tangerine-wallet-browser-f49fb149ccae56f5522a892778d83360856fe880.tar.bz2
tangerine-wallet-browser-f49fb149ccae56f5522a892778d83360856fe880.tar.lz
tangerine-wallet-browser-f49fb149ccae56f5522a892778d83360856fe880.tar.xz
tangerine-wallet-browser-f49fb149ccae56f5522a892778d83360856fe880.tar.zst
tangerine-wallet-browser-f49fb149ccae56f5522a892778d83360856fe880.zip
background - txManager - filter txs by network
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/background.js5
-rw-r--r--app/scripts/transaction-manager.js5
2 files changed, 6 insertions, 4 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 3f15488ee..f3837a028 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -22,7 +22,7 @@ const controller = new MetamaskController({
setData,
loadData,
})
-const txManager = controller.txManager
+
function triggerUi () {
if (!popupIsOpen) notification.show()
}
@@ -93,7 +93,8 @@ function setupControllerConnection (stream) {
// plugin badge text
//
-txManager.on('updateBadge', updateBadge)
+controller.txManager.on('updateBadge', updateBadge)
+updateBadge()
function updateBadge () {
var label = ''
diff --git a/app/scripts/transaction-manager.js b/app/scripts/transaction-manager.js
index 5a44705b7..87f99ce62 100644
--- a/app/scripts/transaction-manager.js
+++ b/app/scripts/transaction-manager.js
@@ -35,7 +35,8 @@ module.exports = class TransactionManager extends EventEmitter {
// Returns the tx list
getTxList () {
- return this.txList
+ let network = this.getNetwork()
+ return this.txList.filter(txMeta => txMeta.metamaskNetworkId === network)
}
// Adds a tx to the txlist
@@ -345,8 +346,8 @@ module.exports = class TransactionManager extends EventEmitter {
if (status === 'submitted' || status === 'rejected') {
this.emit(`${txMeta.id}:finished`, status)
}
- this.emit('updateBadge')
this.updateTx(txMeta)
+ this.emit('updateBadge')
}
// Saves the new/updated txList.