passing tokens to all accounts in migration

This commit is contained in:
Esteban MIno 2018-07-30 11:41:31 -04:00
parent dd6a725e6d
commit 0757f47e84
1 changed files with 6 additions and 3 deletions

View File

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