diff options
Diffstat (limited to 'ui/app/reducers')
-rw-r--r-- | ui/app/reducers/app.js | 46 | ||||
-rw-r--r-- | ui/app/reducers/metamask.js | 16 |
2 files changed, 55 insertions, 7 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 7f4537510..ae91272cc 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -43,7 +43,19 @@ function reduceApp (state, action) { switch (action.type) { - // intialize + // transition methods + + case actions.TRANSITION_FORWARD: + return extend(appState, { + transForward: true, + }) + + case actions.TRANSITION_BACKWARD: + return extend(appState, { + transForward: false, + }) + + // intialize case actions.SHOW_CREATE_VAULT: return extend(appState, { @@ -60,6 +72,16 @@ function reduceApp (state, action) { name: 'restoreVault', }, transForward: true, + forgottenPassword: true, + }) + + case actions.FORGOT_PASSWORD: + return extend(appState, { + currentView: { + name: 'restoreVault', + }, + transForward: false, + forgottenPassword: true, }) case actions.SHOW_INIT_MENU: @@ -77,6 +99,14 @@ function reduceApp (state, action) { transForward: action.value, }) + case actions.SHOW_IMPORT_PAGE: + return extend(appState, { + currentView: { + name: 'import-menu', + }, + transForward: true, + }) + case actions.SHOW_INFO_PAGE: return extend(appState, { currentView: { @@ -166,7 +196,7 @@ function reduceApp (state, action) { return extend(appState, { warning: null, transForward: true, - forgottenPassword: !appState.forgottenPassword, + forgottenPassword: false, currentView: { name: 'UnlockScreen', }, @@ -242,6 +272,13 @@ function reduceApp (state, action) { isLoading: false, warning: null, scrollToBottom: false, + forgottenPassword: false, + }) + + case actions.SHOW_NOTICE: + return extend(appState, { + transForward: true, + isLoading: false, }) case actions.REVEAL_ACCOUNT: @@ -287,7 +324,6 @@ function reduceApp (state, action) { warning: null, }) } else { - notification.closePopup() return extend(appState, { @@ -295,7 +331,7 @@ function reduceApp (state, action) { warning: null, currentView: { name: 'accountDetail', - context: state.metamask.selectedAddress, + context: state.metamask.selectedAccount, }, accountDetail: { subview: 'transactions', @@ -427,7 +463,7 @@ function reduceApp (state, action) { }, buyView: { subview: 'buyForm', - amount: '5.00', + amount: '15.00', buyAddress: action.value, formView: { coinbase: true, diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js index aa809b333..8679ab062 100644 --- a/ui/app/reducers/metamask.js +++ b/ui/app/reducers/metamask.js @@ -16,6 +16,8 @@ function reduceMetamask (state, action) { currentFiat: 'USD', conversionRate: 0, conversionDate: 'N/A', + noActiveNotices: true, + lastUnreadNotice: undefined, }, state.metamask) switch (action.type) { @@ -25,12 +27,23 @@ function reduceMetamask (state, action) { delete newState.seedWords return newState + case actions.SHOW_NOTICE: + return extend(metamaskState, { + noActiveNotices: false, + lastUnreadNotice: action.value, + }) + + case actions.CLEAR_NOTICES: + return extend(metamaskState, { + noActiveNotices: true, + }) + case actions.UPDATE_METAMASK_STATE: return extend(metamaskState, action.value) case actions.AGREE_TO_DISCLAIMER: return extend(metamaskState, { - isConfirmed: true, + isDisclaimerConfirmed: true, }) case actions.UNLOCK_METAMASK: @@ -98,7 +111,6 @@ function reduceMetamask (state, action) { isUnlocked: true, isInitialized: true, selectedAccount: action.value, - selectedAddress: action.value, }) delete newState.seedWords return newState |