diff options
author | Dan <danjm.com@gmail.com> | 2017-11-10 11:49:16 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-11-15 08:18:00 +0800 |
commit | 9e3f921ba928a948c04b4156daa0a3f752ee2dde (patch) | |
tree | 61879e2bdcf2250e1c8ee7798e78df001f2ca3f0 /ui/app/components/pending-tx | |
parent | 4671f28476165fec43785ae23352c1e9a0776abc (diff) | |
download | tangerine-wallet-browser-9e3f921ba928a948c04b4156daa0a3f752ee2dde.tar.gz tangerine-wallet-browser-9e3f921ba928a948c04b4156daa0a3f752ee2dde.tar.zst tangerine-wallet-browser-9e3f921ba928a948c04b4156daa0a3f752ee2dde.zip |
Create single action for updating all of send in redux state.
Diffstat (limited to 'ui/app/components/pending-tx')
-rw-r--r-- | ui/app/components/pending-tx/confirm-send-ether.js | 15 | ||||
-rw-r--r-- | ui/app/components/pending-tx/confirm-send-token.js | 15 |
2 files changed, 18 insertions, 12 deletions
diff --git a/ui/app/components/pending-tx/confirm-send-ether.js b/ui/app/components/pending-tx/confirm-send-ether.js index b4d955b80..1264da153 100644 --- a/ui/app/components/pending-tx/confirm-send-ether.js +++ b/ui/app/components/pending-tx/confirm-send-ether.js @@ -43,12 +43,15 @@ function mapDispatchToProps (dispatch) { to, value: amount, } = txParams - dispatch(actions.editTx(id)) - dispatch(actions.updateGasLimit(gasLimit)) - dispatch(actions.updateGasPrice(gasPrice)) - dispatch(actions.updateSendTo(to)) - dispatch(actions.updateSendAmount(amount)) - dispatch(actions.updateSendErrors({ to: null, amount: null })) + dispatch(actions.updateSend({ + gasLimit, + gasPrice, + gasTotal: null, + to, + amount, + errors: { to: null, amount: null }, + editingTransactionId: id, + })) dispatch(actions.showSendPage()) }, cancelTransaction: ({ id }) => dispatch(actions.cancelTx({ id })), diff --git a/ui/app/components/pending-tx/confirm-send-token.js b/ui/app/components/pending-tx/confirm-send-token.js index aab45f2a4..cc2df8299 100644 --- a/ui/app/components/pending-tx/confirm-send-token.js +++ b/ui/app/components/pending-tx/confirm-send-token.js @@ -77,13 +77,16 @@ function mapDispatchToProps (dispatch, ownProps) { gasPrice, to, } = txParams - dispatch(actions.editTx(id)) - dispatch(actions.updateGasLimit(gasLimit)) - dispatch(actions.updateGasPrice(gasPrice)) - dispatch(actions.updateSendTo(to)) - dispatch(actions.updateSendAmount(amount)) - dispatch(actions.updateSendErrors({ to: null, amount: null })) dispatch(actions.setSelectedToken(address)) + dispatch(actions.updateSend({ + gasLimit, + gasPrice, + gasTotal: null, + to, + amount, + errors: { to: null, amount: null }, + editingTransactionId: id, + })) dispatch(actions.showSendTokenPage()) }, } |