aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pending-tx/confirm-send-token.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-12-21 01:17:16 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-12-21 09:37:18 +0800
commitbf4043c59bb67ea93599207d91cb7a4f4426e75f (patch)
tree04013dc75d07ede37a6b0dbbf616a1dbff0c75b1 /ui/app/components/pending-tx/confirm-send-token.js
parent1f1fc2c49ecbb5c6a0a1d925d5c02cf48f795b2f (diff)
downloadtangerine-wallet-browser-bf4043c59bb67ea93599207d91cb7a4f4426e75f.tar.gz
tangerine-wallet-browser-bf4043c59bb67ea93599207d91cb7a4f4426e75f.tar.zst
tangerine-wallet-browser-bf4043c59bb67ea93599207d91cb7a4f4426e75f.zip
Adds updateTransaction to background and used it to update after editing in send-v2.
Diffstat (limited to 'ui/app/components/pending-tx/confirm-send-token.js')
-rw-r--r--ui/app/components/pending-tx/confirm-send-token.js42
1 files changed, 2 insertions, 40 deletions
diff --git a/ui/app/components/pending-tx/confirm-send-token.js b/ui/app/components/pending-tx/confirm-send-token.js
index e6ce3f6e6..a07835911 100644
--- a/ui/app/components/pending-tx/confirm-send-token.js
+++ b/ui/app/components/pending-tx/confirm-send-token.js
@@ -89,7 +89,6 @@ function mapDispatchToProps (dispatch, ownProps) {
}))
dispatch(actions.showSendTokenPage())
},
- updateAndCancelTx: txMeta => dispatch(actions.updateAndCancelTx(txMeta)),
}
}
@@ -416,13 +415,9 @@ ConfirmSendToken.prototype.onSubmit = function (event) {
ConfirmSendToken.prototype.cancel = function (event, txMeta) {
event.preventDefault()
- const { send, updateAndCancelTx, cancelTransaction } = this.props
+ const { send, cancelTransaction } = this.props
- if (send.editingTransactionId) {
- updateAndCancelTx(txMeta)
- } else {
- cancelTransaction(txMeta)
- }
+ cancelTransaction(txMeta)
}
ConfirmSendToken.prototype.checkValidity = function () {
@@ -446,39 +441,6 @@ ConfirmSendToken.prototype.gatherTxMeta = function () {
const state = this.state
const txData = clone(state.txData) || clone(props.txData)
- if (props.send.editingTransactionId) {
- const {
- send: {
- memo,
- amount,
- gasLimit: gas,
- gasPrice,
- to,
- },
- } = props
-
- const { txParams: { from, to: tokenAddress } } = txData
-
- const tokenParams = {
- from: ethUtil.addHexPrefix(from),
- value: '0',
- gas: ethUtil.addHexPrefix(gas),
- gasPrice: ethUtil.addHexPrefix(gasPrice),
- }
-
- const data = '0xa9059cbb' + Array.prototype.map.call(
- ethAbi.rawEncode(['address', 'uint256'], [to, ethUtil.addHexPrefix(amount)]),
- x => ('00' + x.toString(16)).slice(-2)
- ).join('')
-
- txData.txParams = {
- ...tokenParams,
- to: ethUtil.addHexPrefix(tokenAddress),
- memo: memo && ethUtil.addHexPrefix(memo),
- data,
- }
- }
-
// log.debug(`UI has defaulted to tx meta ${JSON.stringify(txData)}`)
return txData
}