diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-01-12 06:58:20 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-01-12 07:15:37 +0800 |
commit | d87a7b2a767def40d89138103eb53c665419cc3d (patch) | |
tree | 9e664d770d32b4fe97b6989a72f83adfc8966750 | |
parent | 479da078979f0eaee05b2e25e1bb7113a5a62d6d (diff) | |
download | tangerine-wallet-browser-d87a7b2a767def40d89138103eb53c665419cc3d.tar tangerine-wallet-browser-d87a7b2a767def40d89138103eb53c665419cc3d.tar.gz tangerine-wallet-browser-d87a7b2a767def40d89138103eb53c665419cc3d.tar.bz2 tangerine-wallet-browser-d87a7b2a767def40d89138103eb53c665419cc3d.tar.lz tangerine-wallet-browser-d87a7b2a767def40d89138103eb53c665419cc3d.tar.xz tangerine-wallet-browser-d87a7b2a767def40d89138103eb53c665419cc3d.tar.zst tangerine-wallet-browser-d87a7b2a767def40d89138103eb53c665419cc3d.zip |
Send update to UI when changing selected account
Fixes #981
-rw-r--r-- | app/scripts/keyring-controller.js | 2 | ||||
-rw-r--r-- | ui/app/actions.js | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index c58be0aae..d4c0d863e 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -273,7 +273,7 @@ module.exports = class KeyringController extends EventEmitter { setSelectedAccount (address) { var addr = normalize(address) this.configManager.setSelectedAccount(addr) - return Promise.resolve(addr) + return this.fullUpdate() } // Save Account Label diff --git a/ui/app/actions.js b/ui/app/actions.js index d63d36f19..5a3968f82 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -263,9 +263,7 @@ function showInfoPage () { } function setSelectedAccount (address) { - return (dispatch) => { - background.setSelectedAccount(address) - } + return callBackgroundThenUpdate(background.setSelectedAccount, address) } function setCurrentFiat (fiat) { @@ -457,15 +455,16 @@ function lockMetamask () { function showAccountDetail (address) { return (dispatch) => { dispatch(actions.showLoadingIndication()) - background.setSelectedAccount(address, (err, address) => { + background.setSelectedAccount(address, (err, newState) => { dispatch(actions.hideLoadingIndication()) if (err) { return dispatch(actions.displayWarning(err.message)) } + dispatch(actions.updateMetamaskState(newState)) dispatch({ type: actions.SHOW_ACCOUNT_DETAIL, - value: address, + value: newState.selectedAccount, }) }) } |