diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/reducers/app.js | 5 | ||||
-rw-r--r-- | ui/index.js | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index c64046518..6d805521b 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -15,6 +15,11 @@ function reduceApp (state, action) { name = 'accountDetail' } + if (hasUnconfActions) { + log.debug('pending txs detected, defaulting to conf-tx view.') + name = 'confTx' + } + var defaultView = { name, detailView: null, diff --git a/ui/index.js b/ui/index.js index f748c1ea2..1afc08683 100644 --- a/ui/index.js +++ b/ui/index.js @@ -36,6 +36,15 @@ function startApp (metamaskState, accountManager, opts) { networkVersion: opts.networkVersion, }) + // if unconfirmed txs, start on txConf page + const unapprovedTxsAll = txHelper(metamaskState.unapprovedTxs, metamaskState.unapprovedMsgs, metamaskState.unapprovedPersonalMsgs, metamaskState.network) + const numberOfUnapprivedTx = unapprovedTxsAll.length + if (numberOfUnapprivedTx > 0) { + store.dispatch(actions.showConfTxPage({ + id: unapprovedTxsAll[numberOfUnapprivedTx - 1].id, + })) + } + accountManager.on('update', function (metamaskState) { store.dispatch(actions.updateMetamaskState(metamaskState)) }) |