aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-09-27 08:03:36 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-09-27 09:42:39 +0800
commit25c2865076784f3e5346f7e34cbf80b9fe210ade (patch)
tree7e9c39e13d657442c434fc2997dff682309d5252
parentbdd1e58e552b50ab5d060a1671d29cf3c2fdf7fa (diff)
downloadtangerine-wallet-browser-25c2865076784f3e5346f7e34cbf80b9fe210ade.tar
tangerine-wallet-browser-25c2865076784f3e5346f7e34cbf80b9fe210ade.tar.gz
tangerine-wallet-browser-25c2865076784f3e5346f7e34cbf80b9fe210ade.tar.bz2
tangerine-wallet-browser-25c2865076784f3e5346f7e34cbf80b9fe210ade.tar.lz
tangerine-wallet-browser-25c2865076784f3e5346f7e34cbf80b9fe210ade.tar.xz
tangerine-wallet-browser-25c2865076784f3e5346f7e34cbf80b9fe210ade.tar.zst
tangerine-wallet-browser-25c2865076784f3e5346f7e34cbf80b9fe210ade.zip
Restore notification functionality
-rw-r--r--ui/app/reducers/app.js5
-rw-r--r--ui/index.js9
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))
})