aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 5068d1848..458145380 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -23,7 +23,8 @@ var actions = {
showCreateVault: showCreateVault,
showRestoreVault: showRestoreVault,
showInitializeMenu: showInitializeMenu,
- createNewVault: createNewVault,
+ createNewVaultAndKeychain: createNewVaultAndKeychain,
+ createNewVaultAndRestore: createNewVaultAndRestore,
createNewVaultInProgress: createNewVaultInProgress,
addNewKeyring,
addNewAccount,
@@ -188,17 +189,27 @@ function confirmSeedWords () {
}
}
-function createNewVault (password, entropy) {
+function createNewVaultAndRestore (password, seed) {
return (dispatch) => {
- // dispatch(actions.createNewVaultInProgress())
- background.createNewVault(password, entropy, (err, newState) => {
+ dispatch(actions.showLoadingIndication())
+ background.createNewVaultAndRestore(password, seed, (err, newState) => {
+ dispatch(actions.hideLoadingIndication())
+ if (err) return dispatch(actions.displayWarning(err.message))
+
+ dispatch(this.updateMetamaskState(newState))
+ })
+ }
+}
+
+function createNewVaultAndKeychain (password, entropy) {
+ return (dispatch) => {
+ background.createNewVaultAndKeychain(password, entropy, (err, newState) => {
if (err) {
return dispatch(actions.showWarning(err.message))
}
dispatch(this.updateMetamaskState(newState))
- dispatch(this.showAccountsPage())
- dispatch(this.hideLoadingIndication())
+ dispatch(this.showNewVaultSeed())
})
}
}