aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/reducers')
-rw-r--r--ui/app/reducers/app.js23
-rw-r--r--ui/app/reducers/metamask.js23
2 files changed, 36 insertions, 10 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index 6885d029a..74a0f9299 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -59,6 +59,7 @@ function reduceApp (state, action) {
// Used to display error text
warning: null,
buyView: {},
+ isMouseUser: false,
}, state.appState)
switch (action.type) {
@@ -137,14 +138,18 @@ function reduceApp (state, action) {
})
case actions.FORGOT_PASSWORD:
- return extend(appState, {
- currentView: {
- name: 'restoreVault',
- },
- transForward: false,
- forgottenPassword: true,
+ const newState = extend(appState, {
+ forgottenPassword: action.value,
})
+ if (action.value) {
+ newState.currentView = {
+ name: 'restoreVault',
+ }
+ }
+
+ return newState
+
case actions.SHOW_INIT_MENU:
return extend(appState, {
currentView: defaultView,
@@ -658,6 +663,12 @@ function reduceApp (state, action) {
data: action.value.data,
},
})
+
+ case actions.SET_MOUSE_USER_STATE:
+ return extend(appState, {
+ isMouseUser: action.value,
+ })
+
default:
return appState
}
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js
index 294c29948..9cba5e83b 100644
--- a/ui/app/reducers/metamask.js
+++ b/ui/app/reducers/metamask.js
@@ -1,6 +1,7 @@
const extend = require('xtend')
const actions = require('../actions')
const MetamascaraPlatform = require('../../../app/scripts/platforms/window')
+const environmentType = require('../../../app/scripts/lib/environment-type')
const { OLD_UI_NETWORK_TYPE } = require('../../../app/scripts/config').enums
module.exports = reduceMetamask
@@ -14,6 +15,7 @@ function reduceMetamask (state, action) {
isUnlocked: false,
isAccountMenuOpen: false,
isMascara: window.platform instanceof MetamascaraPlatform,
+ isPopup: environmentType() === 'popup',
rpcTarget: 'https://rawtestrpc.metamask.io/',
identities: {},
unapprovedTxs: {},
@@ -36,17 +38,23 @@ function reduceMetamask (state, action) {
errors: {},
maxModeOn: false,
editingTransactionId: null,
+ forceGasMin: null,
+ toNickname: '',
},
coinOptions: {},
useBlockie: false,
featureFlags: {},
networkEndpointType: OLD_UI_NETWORK_TYPE,
+ isRevealingSeedWords: false,
+ welcomeScreenSeen: false,
}, state.metamask)
switch (action.type) {
case actions.SHOW_ACCOUNTS_PAGE:
- newState = extend(metamaskState)
+ newState = extend(metamaskState, {
+ isRevealingSeedWords: false,
+ })
delete newState.seedWords
return newState
@@ -122,10 +130,10 @@ function reduceMetamask (state, action) {
},
})
+
case actions.SHOW_NEW_VAULT_SEED:
return extend(metamaskState, {
- isUnlocked: true,
- isInitialized: false,
+ isRevealingSeedWords: true,
seedWords: action.value,
})
@@ -231,7 +239,8 @@ function reduceMetamask (state, action) {
return extend(metamaskState, {
send: {
...metamaskState.send,
- to: action.value,
+ to: action.value.to,
+ toNickname: action.value.nickname,
},
})
@@ -291,6 +300,7 @@ function reduceMetamask (state, action) {
memo: '',
errors: {},
editingTransactionId: null,
+ forceGasMin: null,
},
})
@@ -342,6 +352,11 @@ function reduceMetamask (state, action) {
networkEndpointType: action.value,
})
+ case actions.CLOSE_WELCOME_SCREEN:
+ return extend(metamaskState, {
+ welcomeScreenSeen: true,
+ })
+
default:
return metamaskState