diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-21 13:31:59 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-21 13:31:59 +0800 |
commit | f503120b82c108efae0a4fc1282a43721d961ca2 (patch) | |
tree | fe99161e92499d04353804bca912d6256c7513c4 /ui/app/actions.js | |
parent | 2b26496826716cc7dd10b3739828f7b82bdc3bd3 (diff) | |
download | tangerine-wallet-browser-f503120b82c108efae0a4fc1282a43721d961ca2.tar tangerine-wallet-browser-f503120b82c108efae0a4fc1282a43721d961ca2.tar.gz tangerine-wallet-browser-f503120b82c108efae0a4fc1282a43721d961ca2.tar.bz2 tangerine-wallet-browser-f503120b82c108efae0a4fc1282a43721d961ca2.tar.lz tangerine-wallet-browser-f503120b82c108efae0a4fc1282a43721d961ca2.tar.xz tangerine-wallet-browser-f503120b82c108efae0a4fc1282a43721d961ca2.tar.zst tangerine-wallet-browser-f503120b82c108efae0a4fc1282a43721d961ca2.zip |
Add Import With Seed Phrase
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 41b4494ad..04fd35b20 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -238,10 +238,20 @@ function createNewVaultAndRestore (password, seed) { return (dispatch) => { dispatch(actions.showLoadingIndication()) log.debug(`background.createNewVaultAndRestore`) - background.createNewVaultAndRestore(password, seed, (err) => { - dispatch(actions.hideLoadingIndication()) - if (err) return dispatch(actions.displayWarning(err.message)) - dispatch(actions.showAccountsPage()) + + return new Promise((resolve, reject) => { + background.createNewVaultAndRestore(password, seed, (err) => { + + dispatch(actions.hideLoadingIndication()) + + if (err) { + dispatch(actions.displayWarning(err.message)) + return reject(err) + } + + dispatch(actions.showAccountsPage()) + resolve() + }) }) } } |