passing tokens to all accounts in migration

feature/default_network_editable
Esteban MIno 6 years ago
parent dd6a725e6d
commit 0757f47e84
  1. 9
      app/scripts/migrations/028.js

@ -26,10 +26,13 @@ function transformState (state) {
if (newState.PreferencesController) {
if (newState.PreferencesController.tokens) {
const tokens = newState.TransactionController.tokens
const selectedAddress = newState.PreferencesController.selectedAddress
const identities = newState.TransactionController.identities
const tokens = newState.PreferencesController.tokens
newState.PreferencesController.accountTokens = {}
for (const identity in identities) {
newState.PreferencesController.accountTokens[identity] = {'mainnet': tokens}
}
newState.PreferencesController.tokens = []
newState.PreferencesController.accountTokens = {[selectedAddress]: {'mainnet': tokens}}
}
}

Loading…
Cancel
Save