aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-10-21 02:00:38 +0800
committerDan Finlay <dan@danfinlay.com>2016-10-21 02:00:38 +0800
commite5c95d68f80eba3e3d4645f7ac1f6606d0dddd52 (patch)
treec2ad537bdd0c1b661ad390bcf67f0f970ae5975f
parent2132477797660a87fec20dbc0a3f839895b23309 (diff)
downloadtangerine-wallet-browser-e5c95d68f80eba3e3d4645f7ac1f6606d0dddd52.tar
tangerine-wallet-browser-e5c95d68f80eba3e3d4645f7ac1f6606d0dddd52.tar.gz
tangerine-wallet-browser-e5c95d68f80eba3e3d4645f7ac1f6606d0dddd52.tar.bz2
tangerine-wallet-browser-e5c95d68f80eba3e3d4645f7ac1f6606d0dddd52.tar.lz
tangerine-wallet-browser-e5c95d68f80eba3e3d4645f7ac1f6606d0dddd52.tar.xz
tangerine-wallet-browser-e5c95d68f80eba3e3d4645f7ac1f6606d0dddd52.tar.zst
tangerine-wallet-browser-e5c95d68f80eba3e3d4645f7ac1f6606d0dddd52.zip
Fix state updating after vault creation and unlocking
-rw-r--r--app/scripts/keyring-controller.js4
-rw-r--r--ui/app/actions.js10
-rw-r--r--ui/app/app.js1
3 files changed, 11 insertions, 4 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index 416d6093c..84601916f 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -72,7 +72,7 @@ module.exports = class KeyringController extends EventEmitter {
})
.then((encryptedString) => {
this.configManager.setVault(encryptedString)
- cb(null, [])
+ cb(null, this.getState())
})
.catch((err) => {
cb(err)
@@ -82,7 +82,7 @@ module.exports = class KeyringController extends EventEmitter {
submitPassword(password, cb) {
this.loadKey(password)
.then((key) => {
- cb(null, [])
+ cb(null, this.getState())
})
.catch((err) => {
cb(err)
diff --git a/ui/app/actions.js b/ui/app/actions.js
index e33a3800a..d5a00833b 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -157,11 +157,16 @@ function tryUnlockMetamask (password) {
return (dispatch) => {
dispatch(actions.showLoadingIndication())
dispatch(actions.unlockInProgress())
- background.submitPassword(password, (err, selectedAccount) => {
+ background.submitPassword(password, (err, newState) => {
dispatch(actions.hideLoadingIndication())
if (err) {
dispatch(actions.unlockFailed())
} else {
+ dispatch(this.updateMetamaskState(newState))
+ let selectedAccount
+ try {
+ selectedAccount = newState.metamask.selectedAccount
+ } catch (e) {}
dispatch(actions.unlockMetamask(selectedAccount))
}
})
@@ -171,10 +176,11 @@ function tryUnlockMetamask (password) {
function createNewVault (password, entropy) {
return (dispatch) => {
dispatch(actions.createNewVaultInProgress())
- background.createNewVault(password, entropy, (err, result) => {
+ background.createNewVault(password, entropy, (err, newState) => {
if (err) {
return dispatch(actions.showWarning(err.message))
}
+ dispatch(this.updateMetamaskState(newState))
dispatch(this.showAccountsPage())
dispatch(this.hideLoadingIndication())
})
diff --git a/ui/app/app.js b/ui/app/app.js
index 7392e275d..cbe02b683 100644
--- a/ui/app/app.js
+++ b/ui/app/app.js
@@ -402,6 +402,7 @@ App.prototype.renderPrimary = function () {
// show initialize screen
if (!props.isInitialized || props.forgottenPassword) {
+
// show current view
switch (props.currentView.name) {