diff options
author | Dan Finlay <flyswatter@users.noreply.github.com> | 2017-03-25 04:53:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-25 04:53:45 +0800 |
commit | c15dfccaa4770539152acdfb81d623f0569e2d51 (patch) | |
tree | 1595c6287f87162e987f76c8f580f87a06ad2cb3 /ui/app/conf-tx.js | |
parent | 61a62038084c29fb29c8445feca36bce9e756471 (diff) | |
parent | 393c7faf28bd94f16c16427f33d830b3b7241538 (diff) | |
download | tangerine-wallet-browser-c15dfccaa4770539152acdfb81d623f0569e2d51.tar tangerine-wallet-browser-c15dfccaa4770539152acdfb81d623f0569e2d51.tar.gz tangerine-wallet-browser-c15dfccaa4770539152acdfb81d623f0569e2d51.tar.bz2 tangerine-wallet-browser-c15dfccaa4770539152acdfb81d623f0569e2d51.tar.lz tangerine-wallet-browser-c15dfccaa4770539152acdfb81d623f0569e2d51.tar.xz tangerine-wallet-browser-c15dfccaa4770539152acdfb81d623f0569e2d51.tar.zst tangerine-wallet-browser-c15dfccaa4770539152acdfb81d623f0569e2d51.zip |
Merge branch 'master' into kovan-notice
Diffstat (limited to 'ui/app/conf-tx.js')
-rw-r--r-- | ui/app/conf-tx.js | 27 |
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()) } |