diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-05-04 06:04:15 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-05-04 06:04:15 +0800 |
commit | 9c6ec054b13f24e88b78ca4124b0d3a46234b1d7 (patch) | |
tree | 6409dd6ea4aee0f58e243959568a4dca3fd0e63d /ui/app/app.js | |
parent | 46e100f595a3db7aaab913bc4c12f4d6c5d01cd5 (diff) | |
download | tangerine-wallet-browser-9c6ec054b13f24e88b78ca4124b0d3a46234b1d7.tar tangerine-wallet-browser-9c6ec054b13f24e88b78ca4124b0d3a46234b1d7.tar.gz tangerine-wallet-browser-9c6ec054b13f24e88b78ca4124b0d3a46234b1d7.tar.bz2 tangerine-wallet-browser-9c6ec054b13f24e88b78ca4124b0d3a46234b1d7.tar.lz tangerine-wallet-browser-9c6ec054b13f24e88b78ca4124b0d3a46234b1d7.tar.xz tangerine-wallet-browser-9c6ec054b13f24e88b78ca4124b0d3a46234b1d7.tar.zst tangerine-wallet-browser-9c6ec054b13f24e88b78ca4124b0d3a46234b1d7.zip |
Show any pending txs when unlocking
Before the unlock action hard-routed to the home route, now it has a condition where it will show pending transactions instead.
Diffstat (limited to 'ui/app/app.js')
-rw-r--r-- | ui/app/app.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/ui/app/app.js b/ui/app/app.js index fce98d8e1..94c72a3c8 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -23,6 +23,7 @@ const ConfirmTxScreen = require('./conf-tx') const ConfigScreen = require('./config') const InfoScreen = require('./info') const LoadingIndicator = require('./loading') +const txHelper = require('../lib/tx-helper') module.exports = connect(mapStateToProps)(App) @@ -39,6 +40,8 @@ function mapStateToProps(state) { activeAddress: state.appState.activeAddress, transForward: state.appState.transForward, seedWords: state.metamask.seedWords, + unconfTxs: state.metamask.unconfTxs, + unconfMsgs: state.metamask.unconfMsgs, } } @@ -202,8 +205,20 @@ App.prototype.renderPrimary = function(state){ return h(CreateVaultScreen, {key: 'createVault'}) default: - return h(AccountDetailScreen, {key: 'account-detail'}) - } + if (this.hasPendingTxs()) { + return h(ConfirmTxScreen, {key: 'confirm-tx'}) + } else { + return h(AccountDetailScreen, {key: 'account-detail'}) + } + } +} + +App.prototype.hasPendingTxs = function() { + var state = this.props + var unconfTxs = state.unconfTxs + var unconfMsgs = state.unconfMsgs + var unconfTxList = txHelper(unconfTxs, unconfMsgs) + return unconfTxList.length > 0 } function onOffToggle(state){ |