aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-09-08 04:20:14 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-09-08 04:20:14 +0800
commit34e7bb50157462d0f0284f2df0fd116e5aff6840 (patch)
tree4ad7da3d4d4df5eb03d94e6641f025defc40e3ee
parenta27a7e22f2dde983301a2bfb58a6bd7bae985f86 (diff)
parentf52ef5d49657d126a2575c91c83481209e8ef0ab (diff)
downloadtangerine-wallet-browser-34e7bb50157462d0f0284f2df0fd116e5aff6840.tar.gz
tangerine-wallet-browser-34e7bb50157462d0f0284f2df0fd116e5aff6840.tar.zst
tangerine-wallet-browser-34e7bb50157462d0f0284f2df0fd116e5aff6840.zip
Merge branch 'master' of github.com:davidp94/metamask-extension into rejectallunapproved
-rw-r--r--ui/app/actions.js11
-rw-r--r--ui/app/conf-tx.js12
2 files changed, 23 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index eebe65ba2..e793e6a21 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -104,6 +104,7 @@ var actions = {
txError: txError,
nextTx: nextTx,
previousTx: previousTx,
+ cancelAllTx: cancelAllTx,
viewPendingTx: viewPendingTx,
VIEW_PENDING_TX: 'VIEW_PENDING_TX',
// app messages
@@ -457,6 +458,16 @@ function cancelTx (txData) {
}
}
+function cancelAllTx (txsData) {
+ return (dispatch) => {
+ txsData.forEach((txData, i) => {
+ background.cancelTransaction(txData.id, () => {
+ dispatch(actions.completedTx(txData.id))
+ i === txsData.length - 1 ? dispatch(actions.goHome()) : null
+ })
+ })
+ }
+}
//
// initialize screen
//
diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js
index 34727ff78..d6ceb7ff5 100644
--- a/ui/app/conf-tx.js
+++ b/ui/app/conf-tx.js
@@ -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({