1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Merge pull request #996 from MetaMask/i981-UpdateOnAccountChange

Send update to UI when changing selected account
This commit is contained in:
kumavis 2017-01-11 15:47:00 -08:00 committed by GitHub
commit b23a24f61d
2 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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,
})
})
}