From 100642c0eacb5a54f35b7f4cb756a79fe1f354f0 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Mon, 29 Jan 2018 23:14:43 -0330 Subject: [PATCH] Fix bug stemming from erroneously persistant unlock failure error message. (#3123) --- ui/app/actions.js | 10 ++++++++++ ui/app/reducers/app.js | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/ui/app/actions.js b/ui/app/actions.js index 25cb2c23f..c52b3cf93 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -55,6 +55,7 @@ var actions = { SET_NEW_ACCOUNT_FORM: 'SET_NEW_ACCOUNT_FORM', unlockMetamask: unlockMetamask, unlockFailed: unlockFailed, + unlockSucceeded, showCreateVault: showCreateVault, showRestoreVault: showRestoreVault, showInitializeMenu: showInitializeMenu, @@ -78,6 +79,7 @@ var actions = { // unlock screen UNLOCK_IN_PROGRESS: 'UNLOCK_IN_PROGRESS', UNLOCK_FAILED: 'UNLOCK_FAILED', + UNLOCK_SUCCEEDED: 'UNLOCK_SUCCEEDED', UNLOCK_METAMASK: 'UNLOCK_METAMASK', LOCK_METAMASK: 'LOCK_METAMASK', tryUnlockMetamask: tryUnlockMetamask, @@ -284,6 +286,7 @@ function tryUnlockMetamask (password) { if (err) { dispatch(actions.unlockFailed(err.message)) } else { + dispatch(actions.unlockSucceeded()) dispatch(actions.transitionForward()) forceUpdateMetamaskState(dispatch) } @@ -890,6 +893,13 @@ function unlockFailed (message) { } } +function unlockSucceeded (message) { + return { + type: actions.UNLOCK_SUCCEEDED, + value: message, + } +} + function unlockMetamask (account) { return { type: actions.UNLOCK_METAMASK, diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index c3ade5cdc..6885d029a 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -484,6 +484,11 @@ function reduceApp (state, action) { warning: action.value || 'Incorrect password. Try again.', }) + case actions.UNLOCK_SUCCEEDED: + return extend(appState, { + warning: '', + }) + case actions.SHOW_LOADING: return extend(appState, { isLoading: true,