1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 17:33:23 +01:00

Fix bug stemming from erroneously persistant unlock failure error message. (#3123)

This commit is contained in:
Dan J Miller 2018-01-29 23:14:43 -03:30 committed by Alexander Tseung
parent b63f0f3de2
commit 100642c0ea
2 changed files with 15 additions and 0 deletions

View File

@ -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,

View File

@ -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,