1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

cancel all txs

This commit is contained in:
DavidNinja 2017-08-14 21:29:21 -07:00
parent 68c6b2d666
commit 399c51c048
2 changed files with 20 additions and 0 deletions

View File

@ -105,6 +105,8 @@ var actions = {
txError: txError,
nextTx: nextTx,
previousTx: previousTx,
cancelAllTx: cancelAllTx,
CANCEL_ALL_TX: 'CANCEL_ALL_TX',
viewPendingTx: viewPendingTx,
VIEW_PENDING_TX: 'VIEW_PENDING_TX',
// app messages
@ -470,6 +472,12 @@ function cancelTx (txData) {
}
}
function cancelAllTx (txsData) {
return (dispatch) => {
txsData.forEach((txData) => dispatch(actions.cancelTx(txData)))
dispatch(actions.goHome())
}
}
//
// initialize screen
//

View File

@ -89,6 +89,18 @@ ConfirmTxScreen.prototype.render = function () {
}),
]),
h('h3', {
style: {
alignSelf: 'flex-end',
display: unconfTxList.length > 1 ? 'block' : 'none',
},
}, [
h('i.fa.fa-trash.fa-lg.cursor-pointer', {
title: 'Cancel All Pending Transactions',
onClick: () => props.dispatch(actions.cancelAllTx(unconfTxList)),
}),
]),
warningIfExists(props.warning),
currentTxView({