1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Add state-labeled events to allow subscribing to any transaction's state change

This commit is contained in:
Dan Finlay 2017-09-13 11:39:39 -07:00
parent 53a467cd1e
commit e4d7fb2447

View File

@ -434,6 +434,7 @@ module.exports = class TransactionController extends EventEmitter {
const txMeta = this.getTx(txId)
txMeta.status = status
this.emit(`${txMeta.id}:${status}`, txId)
this.emit(`${status}`, txId)
if (status === 'submitted' || status === 'rejected') {
this.emit(`${txMeta.id}:finished`, txMeta)
}