aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pending-tx
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/pending-tx')
-rw-r--r--ui/app/components/pending-tx/confirm-send-ether.js9
-rw-r--r--ui/app/components/pending-tx/confirm-send-token.js9
2 files changed, 16 insertions, 2 deletions
diff --git a/ui/app/components/pending-tx/confirm-send-ether.js b/ui/app/components/pending-tx/confirm-send-ether.js
index 1264da153..01195502e 100644
--- a/ui/app/components/pending-tx/confirm-send-ether.js
+++ b/ui/app/components/pending-tx/confirm-send-ether.js
@@ -55,6 +55,7 @@ function mapDispatchToProps (dispatch) {
dispatch(actions.showSendPage())
},
cancelTransaction: ({ id }) => dispatch(actions.cancelTx({ id })),
+ updateAndCancelTx: txMeta => dispatch(actions.updateAndCancelTx(txMeta)),
}
}
@@ -421,7 +422,13 @@ ConfirmSendEther.prototype.onSubmit = function (event) {
ConfirmSendEther.prototype.cancel = function (event, txMeta) {
event.preventDefault()
- this.props.cancelTransaction(txMeta)
+ const { send, updateAndCancelTx, cancelTransaction } = this.props
+
+ if (send.editingTransactionId) {
+ updateAndCancelTx(txMeta)
+ } else {
+ cancelTransaction(txMeta)
+ }
}
ConfirmSendEther.prototype.checkValidity = function () {
diff --git a/ui/app/components/pending-tx/confirm-send-token.js b/ui/app/components/pending-tx/confirm-send-token.js
index 727cd260b..e6ce3f6e6 100644
--- a/ui/app/components/pending-tx/confirm-send-token.js
+++ b/ui/app/components/pending-tx/confirm-send-token.js
@@ -89,6 +89,7 @@ function mapDispatchToProps (dispatch, ownProps) {
}))
dispatch(actions.showSendTokenPage())
},
+ updateAndCancelTx: txMeta => dispatch(actions.updateAndCancelTx(txMeta)),
}
}
@@ -415,7 +416,13 @@ ConfirmSendToken.prototype.onSubmit = function (event) {
ConfirmSendToken.prototype.cancel = function (event, txMeta) {
event.preventDefault()
- this.props.cancelTransaction(txMeta)
+ const { send, updateAndCancelTx, cancelTransaction } = this.props
+
+ if (send.editingTransactionId) {
+ updateAndCancelTx(txMeta)
+ } else {
+ cancelTransaction(txMeta)
+ }
}
ConfirmSendToken.prototype.checkValidity = function () {