diff options
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 8218e05ef..070ba2da0 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -30,6 +30,10 @@ var actions = { addNewAccount, showNewVaultSeed: showNewVaultSeed, showInfoPage: showInfoPage, + // seed recovery actions + REVEAL_SEED_CONFIRMATION: 'REVEAL_SEED_CONFIRMATION', + revealSeedConfirmation: revealSeedConfirmation, + requestRevealSeed: requestRevealSeed, // unlock screen UNLOCK_IN_PROGRESS: 'UNLOCK_IN_PROGRESS', UNLOCK_FAILED: 'UNLOCK_FAILED', @@ -213,6 +217,25 @@ function createNewVaultAndKeychain (password, entropy) { } } +function revealSeedConfirmation () { + return { + type: this.REVEAL_SEED_CONFIRMATION, + } +} + +function requestRevealSeed (password) { + return (dispatch) => { + dispatch(actions.showLoadingIndication()) + background.submitPassword(password, (err, newState) => { + dispatch(actions.hideLoadingIndication()) + if (err) return dispatch(actions.displayWarning(err.message)) + background.placeSeedWords() + dispatch(actions.showNewVaultSeed()) + }) + } +} + + function addNewKeyring (type, opts) { return (dispatch) => { dispatch(actions.showLoadingIndication()) |