aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-21 01:58:48 +0800
committerDan <danjm.com@gmail.com>2018-03-21 02:22:45 +0800
commit3830f49ac57f3bf506298e6c8afac11fb8a942b4 (patch)
tree42e4bbbb8781cd0ffbd69d491b585e58530793fe
parent49e3ada382e061216ce4306ab17145b94e08ed62 (diff)
downloadtangerine-wallet-browser-3830f49ac57f3bf506298e6c8afac11fb8a942b4.tar
tangerine-wallet-browser-3830f49ac57f3bf506298e6c8afac11fb8a942b4.tar.gz
tangerine-wallet-browser-3830f49ac57f3bf506298e6c8afac11fb8a942b4.tar.bz2
tangerine-wallet-browser-3830f49ac57f3bf506298e6c8afac11fb8a942b4.tar.lz
tangerine-wallet-browser-3830f49ac57f3bf506298e6c8afac11fb8a942b4.tar.xz
tangerine-wallet-browser-3830f49ac57f3bf506298e6c8afac11fb8a942b4.tar.zst
tangerine-wallet-browser-3830f49ac57f3bf506298e6c8afac11fb8a942b4.zip
Take user home if an unapproved tx is dropped while they are viewing.
-rw-r--r--ui/app/conf-tx.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js
index b4ffc48b7..1070436c3 100644
--- a/ui/app/conf-tx.js
+++ b/ui/app/conf-tx.js
@@ -40,6 +40,7 @@ function mapStateToProps (state) {
currentCurrency: state.metamask.currentCurrency,
blockGasLimit: state.metamask.currentBlockGasLimit,
computedBalances: state.metamask.computedBalances,
+ selectedAddressTxList: state.metamask.selectedAddressTxList,
}
}
@@ -48,6 +49,23 @@ function ConfirmTxScreen () {
Component.call(this)
}
+ConfirmTxScreen.prototype.componentDidUpdate = function (prevProps) {
+ const {
+ unapprovedTxs,
+ network,
+ selectedAddressTxList,
+ } = this.props
+ const { index: prevIndex, unapprovedTxs: prevUnapprovedTxs } = prevProps
+ const prevUnconfTxList = txHelper(prevUnapprovedTxs, {}, {}, {}, network)
+ const prevTxData = prevUnconfTxList[prevIndex] || {}
+ const prevTx = selectedAddressTxList.find(({ id }) => id === prevTxData.id) || {}
+ const unconfTxList = txHelper(unapprovedTxs, {}, {}, {}, network)
+
+ if (prevTx.status === 'dropped' && unconfTxList.length === 0) {
+ this.goHome({})
+ }
+}
+
ConfirmTxScreen.prototype.render = function () {
const props = this.props
const {