aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2017-01-25 07:39:33 +0800
committerGitHub <noreply@github.com>2017-01-25 07:39:33 +0800
commit70b8e640f0170281b92ac610e063351a74d5333d (patch)
treeb87831b7cf4acb06a0bca115b12e8be64210f455 /ui/app/actions.js
parent463a56ff54b0d850c86348e260e5f7c17b138ccb (diff)
parent23c2b0b9a5d3f222bfeba7bcff5cf5a57367ffc8 (diff)
downloadtangerine-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.js19
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,
}
}