aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/conf-tx.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/conf-tx.js')
-rw-r--r--ui/app/conf-tx.js27
1 files changed, 17 insertions, 10 deletions
diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js
index 07985094c..54c171a8a 100644
--- a/ui/app/conf-tx.js
+++ b/ui/app/conf-tx.js
@@ -43,8 +43,8 @@ ConfirmTxScreen.prototype.render = function () {
unapprovedMsgs, unapprovedPersonalMsgs } = props
var unconfTxList = txHelper(unapprovedTxs, unapprovedMsgs, unapprovedPersonalMsgs, network)
- var index = props.index !== undefined && unconfTxList[index] ? props.index : 0
- var txData = unconfTxList[index] || {}
+
+ var txData = unconfTxList[props.index] || {}
var txParams = txData.params || {}
var isNotification = isPopupOrNotification() === 'notification'
@@ -158,7 +158,7 @@ ConfirmTxScreen.prototype.checkBalanceAgainstTx = function (txData) {
}
ConfirmTxScreen.prototype.buyEth = function (address, event) {
- event.stopPropagation()
+ this.stopPropagation(event)
this.props.dispatch(actions.buyEthView(address))
}
@@ -172,14 +172,15 @@ ConfirmTxScreen.prototype.onTxChange = function (txData) {
// Must default to any local state txData,
// to allow manual override of gas calculations.
ConfirmTxScreen.prototype.sendTransaction = function (txData, event) {
- event.stopPropagation()
+ this.stopPropagation(event)
const state = this.state || {}
const txMeta = state.txData
this.props.dispatch(actions.updateAndApproveTx(txMeta || txData))
}
ConfirmTxScreen.prototype.cancelTransaction = function (txData, event) {
- event.stopPropagation()
+ this.stopPropagation(event)
+ event.preventDefault()
this.props.dispatch(actions.cancelTx(txData))
}
@@ -187,32 +188,38 @@ ConfirmTxScreen.prototype.signMessage = function (msgData, event) {
log.info('conf-tx.js: signing message')
var params = msgData.msgParams
params.metamaskId = msgData.id
- event.stopPropagation()
+ this.stopPropagation(event)
this.props.dispatch(actions.signMsg(params))
}
+ConfirmTxScreen.prototype.stopPropagation = function (event) {
+ if (event.stopPropagation) {
+ event.stopPropagation()
+ }
+}
+
ConfirmTxScreen.prototype.signPersonalMessage = function (msgData, event) {
log.info('conf-tx.js: signing personal message')
var params = msgData.msgParams
params.metamaskId = msgData.id
- event.stopPropagation()
+ this.stopPropagation(event)
this.props.dispatch(actions.signPersonalMsg(params))
}
ConfirmTxScreen.prototype.cancelMessage = function (msgData, event) {
log.info('canceling message')
- event.stopPropagation()
+ this.stopPropagation(event)
this.props.dispatch(actions.cancelMsg(msgData))
}
ConfirmTxScreen.prototype.cancelPersonalMessage = function (msgData, event) {
log.info('canceling personal message')
- event.stopPropagation()
+ this.stopPropagation(event)
this.props.dispatch(actions.cancelPersonalMsg(msgData))
}
ConfirmTxScreen.prototype.goHome = function (event) {
- event.stopPropagation()
+ this.stopPropagation(event)
this.props.dispatch(actions.goHome())
}