mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
background - txManager - filter txs by network
This commit is contained in:
parent
c3d491a37c
commit
f49fb149cc
@ -22,7 +22,7 @@ const controller = new MetamaskController({
|
|||||||
setData,
|
setData,
|
||||||
loadData,
|
loadData,
|
||||||
})
|
})
|
||||||
const txManager = controller.txManager
|
|
||||||
function triggerUi () {
|
function triggerUi () {
|
||||||
if (!popupIsOpen) notification.show()
|
if (!popupIsOpen) notification.show()
|
||||||
}
|
}
|
||||||
@ -93,7 +93,8 @@ function setupControllerConnection (stream) {
|
|||||||
// plugin badge text
|
// plugin badge text
|
||||||
//
|
//
|
||||||
|
|
||||||
txManager.on('updateBadge', updateBadge)
|
controller.txManager.on('updateBadge', updateBadge)
|
||||||
|
updateBadge()
|
||||||
|
|
||||||
function updateBadge () {
|
function updateBadge () {
|
||||||
var label = ''
|
var label = ''
|
||||||
|
@ -35,7 +35,8 @@ module.exports = class TransactionManager extends EventEmitter {
|
|||||||
|
|
||||||
// Returns the tx list
|
// Returns the tx list
|
||||||
getTxList () {
|
getTxList () {
|
||||||
return this.txList
|
let network = this.getNetwork()
|
||||||
|
return this.txList.filter(txMeta => txMeta.metamaskNetworkId === network)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds a tx to the txlist
|
// Adds a tx to the txlist
|
||||||
@ -345,8 +346,8 @@ module.exports = class TransactionManager extends EventEmitter {
|
|||||||
if (status === 'submitted' || status === 'rejected') {
|
if (status === 'submitted' || status === 'rejected') {
|
||||||
this.emit(`${txMeta.id}:finished`, status)
|
this.emit(`${txMeta.id}:finished`, status)
|
||||||
}
|
}
|
||||||
this.emit('updateBadge')
|
|
||||||
this.updateTx(txMeta)
|
this.updateTx(txMeta)
|
||||||
|
this.emit('updateBadge')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Saves the new/updated txList.
|
// Saves the new/updated txList.
|
||||||
|
Loading…
Reference in New Issue
Block a user