add & delete tokens per network

feature/default_network_editable
Esteban MIno 6 years ago
parent 1d3ad7cfbb
commit 2827e13caa
  1. 4
      app/scripts/controllers/preferences.js
  2. 3
      ui/app/actions.js

@ -204,7 +204,6 @@ class PreferencesController {
*
*/
setSelectedAddress (_address) {
return new Promise((resolve, reject) => {
const address = normalizeAddress(_address)
const addressTokens = this.store.getState().addressTokens
const providerType = this.network.providerStore.getState().type
@ -216,8 +215,7 @@ class PreferencesController {
const tokens = addressTokens[providerType][address]
this.store.updateState({ selectedAddress: address, tokens })
resolve()
})
return Promise.resolve(tokens)
}
/**

@ -1483,11 +1483,12 @@ function showAccountDetail (address) {
return (dispatch) => {
dispatch(actions.showLoadingIndication())
log.debug(`background.setSelectedAddress`)
background.setSelectedAddress(address, (err) => {
background.setSelectedAddress(address, (err, tokens) => {
dispatch(actions.hideLoadingIndication())
if (err) {
return dispatch(actions.displayWarning(err.message))
}
dispatch(updateTokens(tokens))
dispatch({
type: actions.SHOW_ACCOUNT_DETAIL,
value: address,

Loading…
Cancel
Save