From 1bbe0ed9e8fb9f9944c27453cb9791686c4d8d9d Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Fri, 4 Nov 2016 12:00:56 -0700 Subject: Scaffold new account view --- ui/app/actions.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ui/app/actions.js') diff --git a/ui/app/actions.js b/ui/app/actions.js index 070ba2da0..0a0a24725 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -28,6 +28,8 @@ var actions = { createNewVaultInProgress: createNewVaultInProgress, addNewKeyring, addNewAccount, + NEW_ACCOUNT_SCREEN: 'NEW_ACCOUNT_SCREEN', + navigateToNewAccountScreen, showNewVaultSeed: showNewVaultSeed, showInfoPage: showInfoPage, // seed recovery actions @@ -250,6 +252,12 @@ function addNewKeyring (type, opts) { } } +function navigateToNewAccountScreen() { + return { + type: this.NEW_ACCOUNT_SCREEN + } +} + function addNewAccount (ringNumber = 0) { return (dispatch) => { dispatch(actions.showLoadingIndication()) -- cgit v1.2.3 From bc623bbe345a9528f9fe19af2e2440540d8e70a7 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Fri, 4 Nov 2016 12:31:03 -0700 Subject: Linted --- ui/app/actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app/actions.js') diff --git a/ui/app/actions.js b/ui/app/actions.js index 0a0a24725..f5456e0d2 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -254,7 +254,7 @@ function addNewKeyring (type, opts) { function navigateToNewAccountScreen() { return { - type: this.NEW_ACCOUNT_SCREEN + type: this.NEW_ACCOUNT_SCREEN, } } -- cgit v1.2.3 From 77bd010543855fafe21ac37e282bc8137ef7a7d8 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 17 Jan 2017 13:47:30 -0800 Subject: Add "import account" menu item + template view --- ui/app/actions.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ui/app/actions.js') diff --git a/ui/app/actions.js b/ui/app/actions.js index 5a3968f82..1f1a707b5 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -32,11 +32,13 @@ var actions = { SHOW_INIT_MENU: 'SHOW_INIT_MENU', SHOW_NEW_VAULT_SEED: 'SHOW_NEW_VAULT_SEED', SHOW_INFO_PAGE: 'SHOW_INFO_PAGE', + SHOW_IMPORT_PAGE: 'SHOW_IMPORT_PAGE', unlockMetamask: unlockMetamask, unlockFailed: unlockFailed, showCreateVault: showCreateVault, showRestoreVault: showRestoreVault, showInitializeMenu: showInitializeMenu, + showImportPage, createNewVaultAndKeychain: createNewVaultAndKeychain, createNewVaultAndRestore: createNewVaultAndRestore, createNewVaultInProgress: createNewVaultInProgress, @@ -376,6 +378,12 @@ function showInitializeMenu () { } } +function showImportPage () { + return { + type: actions.SHOW_IMPORT_PAGE, + } +} + function agreeToDisclaimer () { return (dispatch) => { dispatch(this.showLoadingIndication()) -- cgit v1.2.3 From 1ff4894b674bbcbac1998228454129018e4642b6 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 17 Jan 2017 16:22:22 -0800 Subject: Allow importing of private key strings Fixes #1021 A top-right menu item now allows `Account Import`. It has a menu (with one item for now) that allows importing a private key string. Errors are displayed, and a success navigates the user to their account list, where the imported account is labeled `LOOSE`. --- ui/app/actions.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ui/app/actions.js') diff --git a/ui/app/actions.js b/ui/app/actions.js index 87b02966b..7934a329a 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -253,7 +253,15 @@ function requestRevealSeed (password) { } function addNewKeyring (type, opts) { - return callBackgroundThenUpdate(background.addNewKeyring, type, opts) + return (dispatch) => { + dispatch(actions.showLoadingIndication()) + background.addNewKeyring(type, opts, (err, newState) => { + dispatch(actions.hideLoadingIndication()) + if (err) return dispatch(actions.displayWarning(err.message)) + dispatch(actions.updateMetamaskState(newState)) + dispatch(actions.showAccountsPage()) + }) + } } function navigateToNewAccountScreen() { -- cgit v1.2.3