diff options
background controller - extract KeyringC.placeSeedWords to MetamaskC
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 9a68d231a..5b2ad8a79 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -230,7 +230,21 @@ function createNewVaultAndRestore (password, seed) { } function createNewVaultAndKeychain (password) { - return callBackgroundThenUpdate(background.createNewVaultAndKeychain, password) + return (dispatch) => { + dispatch(actions.showLoadingIndication()) + background.createNewVaultAndKeychain(password, (err, newState) => { + if (err) { + return dispatch(actions.displayWarning(err.message)) + } + background.placeSeedWords((err, newState) => { + if (err) { + return dispatch(actions.displayWarning(err.message)) + } + dispatch(actions.hideLoadingIndication()) + dispatch(actions.updateMetamaskState(newState)) + }) + }) + } } function revealSeedConfirmation () { |