aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers/app.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2016-05-26 09:08:21 +0800
committerkumavis <kumavis@users.noreply.github.com>2016-05-26 09:08:21 +0800
commit7c7fa23374a2d71eab03f53a766452ba6d711cb7 (patch)
tree108f6a7c3b50b1b4b5b85865d25fdd4105b14038 /ui/app/reducers/app.js
parent2451ddbbb69b4a01bbc56c2ee98a1e4d5ad3854f (diff)
parente8eae89576161722a8b8f4931de0daad62955ab0 (diff)
downloadtangerine-wallet-browser-7c7fa23374a2d71eab03f53a766452ba6d711cb7.tar
tangerine-wallet-browser-7c7fa23374a2d71eab03f53a766452ba6d711cb7.tar.gz
tangerine-wallet-browser-7c7fa23374a2d71eab03f53a766452ba6d711cb7.tar.bz2
tangerine-wallet-browser-7c7fa23374a2d71eab03f53a766452ba6d711cb7.tar.lz
tangerine-wallet-browser-7c7fa23374a2d71eab03f53a766452ba6d711cb7.tar.xz
tangerine-wallet-browser-7c7fa23374a2d71eab03f53a766452ba6d711cb7.tar.zst
tangerine-wallet-browser-7c7fa23374a2d71eab03f53a766452ba6d711cb7.zip
Merge pull request #220 from MetaMask/FixTransactionBackButton
SignTransaction return button broken
Diffstat (limited to 'ui/app/reducers/app.js')
-rw-r--r--ui/app/reducers/app.js24
1 files changed, 20 insertions, 4 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index 493246a35..a98b809d6 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -9,8 +9,17 @@ function reduceApp(state, action) {
// clone and defaults
const selectedAccount = state.metamask.selectedAccount
+ const pendingTxs = hasPendingTxs(state)
+ let name = 'accounts'
+ if (selectedAccount) {
+ defaultView = 'accountDetail'
+ }
+ if (pendingTxs) {
+ defaultView = 'confTx'
+ }
+
var defaultView = {
- name: selectedAccount ? 'accountDetail' : 'accounts',
+ name,
detailView: null,
context: selectedAccount,
}
@@ -122,7 +131,6 @@ function reduceApp(state, action) {
case actions.UNLOCK_METAMASK:
return extend(appState, {
- currentView: {},
detailView: {},
transForward: true,
isLoading: false,
@@ -145,7 +153,9 @@ function reduceApp(state, action) {
case actions.GO_HOME:
return extend(appState, {
- currentView: {},
+ currentView: extend(appState.currentView, {
+ name: 'accountDetail',
+ }),
accountDetail: {
subview: 'transactions',
accountExport: 'none',
@@ -347,6 +357,12 @@ function reduceApp(state, action) {
default:
return appState
-
}
}
+
+function hasPendingTxs (state) {
+ var unconfTxs = state.metamask.unconfTxs
+ var unconfMsgs = state.metamask.unconfMsgs
+ var unconfTxList = txHelper(unconfTxs, unconfMsgs)
+ return unconfTxList.length > 0
+}