diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-04-03 16:03:31 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-04-03 16:03:31 +0800 |
commit | 35875863d2feafc1f653e17e0f58efc2f18ddc46 (patch) | |
tree | 5d40581a08201b3f37c7b31fe2aab4675d827f6b /ui/app/conf-tx.js | |
parent | 516c1869b0f366a42282a66e14185ce630f883dd (diff) | |
parent | c14ec4191741c444dcf5b7c3e177c17a10374c16 (diff) | |
download | tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.gz tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.bz2 tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.lz tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.xz tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.tar.zst tangerine-wallet-browser-35875863d2feafc1f653e17e0f58efc2f18ddc46.zip |
Fix merge conflicts. Modify send workflow
Diffstat (limited to 'ui/app/conf-tx.js')
-rw-r--r-- | ui/app/conf-tx.js | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js index 3134cf331..886d98be7 100644 --- a/ui/app/conf-tx.js +++ b/ui/app/conf-tx.js @@ -55,11 +55,25 @@ function ConfirmTxScreen () { Component.call(this) } +ConfirmTxScreen.prototype.componentDidMount = function () { + const { + unapprovedTxs = {}, + network, + send, + } = this.props + const unconfTxList = txHelper(unapprovedTxs, {}, {}, {}, network) + + if (unconfTxList.length === 0 && !send.to) { + this.props.history.push(DEFAULT_ROUTE) + } +} + ConfirmTxScreen.prototype.componentDidUpdate = function (prevProps) { const { - unapprovedTxs, + unapprovedTxs = {}, network, selectedAddressTxList, + send, } = this.props const { index: prevIndex, unapprovedTxs: prevUnapprovedTxs } = prevProps const prevUnconfTxList = txHelper(prevUnapprovedTxs, {}, {}, {}, network) @@ -67,7 +81,7 @@ ConfirmTxScreen.prototype.componentDidUpdate = function (prevProps) { const prevTx = selectedAddressTxList.find(({ id }) => id === prevTxData.id) || {} const unconfTxList = txHelper(unapprovedTxs, {}, {}, {}, network) - if (prevTx.status === 'dropped' && unconfTxList.length === 0) { + if (unconfTxList.length === 0 && (prevTx.status === 'dropped' || !send.to)) { this.props.history.push(DEFAULT_ROUTE) } } @@ -109,13 +123,6 @@ ConfirmTxScreen.prototype.render = function () { */ log.info(`rendering a combined ${unconfTxList.length} unconf msg & txs`) - if (unconfTxList.length === 0) { - return h(Redirect, { - to: { - pathname: DEFAULT_ROUTE, - }, - }) - } return currentTxView({ // Properties |