aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/app/accounts/index.js6
-rw-r--r--ui/app/actions.js17
2 files changed, 19 insertions, 4 deletions
diff --git a/ui/app/accounts/index.js b/ui/app/accounts/index.js
index 92054f24d..c742d9fac 100644
--- a/ui/app/accounts/index.js
+++ b/ui/app/accounts/index.js
@@ -87,7 +87,7 @@ AccountsScreen.prototype.render = function () {
h('div.footer.hover-white.pointer', {
key: 'reveal-account-bar',
onClick: () => {
- this.addNewKeyring()
+ this.addNewAccount()
},
style: {
display: 'flex',
@@ -146,8 +146,8 @@ AccountsScreen.prototype.onShowDetail = function (address, event) {
this.props.dispatch(actions.showAccountDetail(address))
}
-AccountsScreen.prototype.addNewKeyring = function () {
- this.props.dispatch(actions.addNewKeyring('Simple Key Pair'))
+AccountsScreen.prototype.addNewAccount = function () {
+ this.props.dispatch(actions.addNewAccount(0))
}
AccountsScreen.prototype.goHome = function () {
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 1f8ba7f04..3ae3a623d 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -25,7 +25,8 @@ var actions = {
showInitializeMenu: showInitializeMenu,
createNewVault: createNewVault,
createNewVaultInProgress: createNewVaultInProgress,
- addNewKeyring: addNewKeyring,
+ addNewKeyring,
+ addNewAccount,
showNewVaultSeed: showNewVaultSeed,
showInfoPage: showInfoPage,
// unlock screen
@@ -178,6 +179,7 @@ function createNewVault (password, entropy) {
if (err) {
return dispatch(actions.showWarning(err.message))
}
+
dispatch(this.updateMetamaskState(newState))
dispatch(this.showAccountsPage())
dispatch(this.hideLoadingIndication())
@@ -199,6 +201,19 @@ function addNewKeyring (type, opts) {
}
}
+function addNewAccount (ringNumber = 0) {
+ return (dispatch) => {
+ dispatch(actions.showLoadingIndication())
+ background.addNewAccount(ringNumber, (err, newState) => {
+ dispatch(this.hideLoadingIndication())
+ if (err) {
+ return dispatch(actions.showWarning(err))
+ }
+ dispatch(this.updateMetamaskState(newState))
+ })
+ }
+}
+
function showInfoPage () {
return {
type: actions.SHOW_INFO_PAGE,