diff options
author | kumavis <kumavis@users.noreply.github.com> | 2017-01-25 07:39:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-25 07:39:33 +0800 |
commit | 70b8e640f0170281b92ac610e063351a74d5333d (patch) | |
tree | b87831b7cf4acb06a0bca115b12e8be64210f455 /ui/app/actions.js | |
parent | 463a56ff54b0d850c86348e260e5f7c17b138ccb (diff) | |
parent | 23c2b0b9a5d3f222bfeba7bcff5cf5a57367ffc8 (diff) | |
download | tangerine-wallet-browser-70b8e640f0170281b92ac610e063351a74d5333d.tar tangerine-wallet-browser-70b8e640f0170281b92ac610e063351a74d5333d.tar.gz tangerine-wallet-browser-70b8e640f0170281b92ac610e063351a74d5333d.tar.bz2 tangerine-wallet-browser-70b8e640f0170281b92ac610e063351a74d5333d.tar.lz tangerine-wallet-browser-70b8e640f0170281b92ac610e063351a74d5333d.tar.xz tangerine-wallet-browser-70b8e640f0170281b92ac610e063351a74d5333d.tar.zst tangerine-wallet-browser-70b8e640f0170281b92ac610e063351a74d5333d.zip |
Merge branch 'dev' into i#1048
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 5b2ad8a79..78af80886 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -43,6 +43,7 @@ var actions = { createNewVaultAndRestore: createNewVaultAndRestore, createNewVaultInProgress: createNewVaultInProgress, addNewKeyring, + importNewAccount, addNewAccount, NEW_ACCOUNT_SCREEN: 'NEW_ACCOUNT_SCREEN', navigateToNewAccountScreen, @@ -278,6 +279,21 @@ function addNewKeyring (type, opts) { } } +function importNewAccount (strategy, args) { + return (dispatch) => { + dispatch(actions.showLoadingIndication('This may take a while, be patient.')) + background.importAccountWithStrategy(strategy, args, (err, newState) => { + dispatch(actions.hideLoadingIndication()) + if (err) return dispatch(actions.displayWarning(err.message)) + dispatch(actions.updateMetamaskState(newState)) + dispatch({ + type: actions.SHOW_ACCOUNT_DETAIL, + value: newState.selectedAccount, + }) + }) + } +} + function navigateToNewAccountScreen() { return { type: this.NEW_ACCOUNT_SCREEN, @@ -628,9 +644,10 @@ function useEtherscanProvider () { } } -function showLoadingIndication () { +function showLoadingIndication (message) { return { type: actions.SHOW_LOADING, + value: message, } } |