diff options
author | Alexander Tseung <alextsg@gmail.com> | 2017-11-29 12:24:35 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2017-12-15 04:50:20 +0800 |
commit | e226b10a89d87af07c7c35ff1251a8264f3bb1b8 (patch) | |
tree | 2a1507463ac1074a39e4ebd3ae609be0a2962bc6 /ui/app/send-v2.js | |
parent | 339eb7d1a687f141e822c745c568063783d44f15 (diff) | |
download | tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.tar tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.tar.gz tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.tar.bz2 tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.tar.lz tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.tar.xz tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.tar.zst tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.zip |
Add react-router to allow use of the browser back button
Diffstat (limited to 'ui/app/send-v2.js')
-rw-r--r-- | ui/app/send-v2.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js index e1b88f0db..32bbdfe6e 100644 --- a/ui/app/send-v2.js +++ b/ui/app/send-v2.js @@ -28,6 +28,7 @@ const { isTokenBalanceSufficient, } = require('./components/send/send-utils') const { isValidAddress } = require('./util') +const { CONFIRM_TRANSACTION_ROUTE } = require('./routes') module.exports = SendTransactionScreen @@ -508,9 +509,9 @@ SendTransactionScreen.prototype.renderForm = function () { SendTransactionScreen.prototype.renderFooter = function () { const { - goHome, clearSend, errors: { amount: amountError, to: toError }, + history, } = this.props const noErrors = !amountError && toError === null @@ -520,7 +521,7 @@ SendTransactionScreen.prototype.renderFooter = function () { h('button.send-v2__cancel-btn', { onClick: () => { clearSend() - goHome() + history.goBack() }, }, 'Cancel'), h(`button.send-v2__next-btn${errorClass}`, { @@ -555,7 +556,7 @@ SendTransactionScreen.prototype.addToAddressBookIfNew = function (newAddress) { SendTransactionScreen.prototype.onSubmit = function (event) { event.preventDefault() const { - from: {address: from}, + from: { address: from }, to, amount, gasLimit: gas, @@ -578,6 +579,7 @@ SendTransactionScreen.prototype.onSubmit = function (event) { if (editingTransactionId) { backToConfirmScreen(editingTransactionId) + this.props.history.push(CONFIRM_TRANSACTION_ROUTE) return } @@ -596,4 +598,6 @@ SendTransactionScreen.prototype.onSubmit = function (event) { selectedToken ? signTokenTx(selectedToken.address, to, amount, txParams) : signTx(txParams) + + this.props.history.push(CONFIRM_TRANSACTION_ROUTE) } |