diff options
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/controllers/preferences.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 193965c2c..0cc61ba61 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -405,13 +405,15 @@ class PreferencesController { /** * Updates `accountTokens` and `tokens` of current account and network according to it. * - * @param {[array]} tokens Array of tokens to be updated. + * @param {array} tokens Array of tokens to be updated. * */ _updateAccountTokens (tokens) { const accountTokens = this.store.getState().accountTokens const selectedAddress = this.store.getState().selectedAddress const providerType = this.network.providerStore.getState().type + if (!(selectedAddress in accountTokens)) accountTokens[selectedAddress] = {} + if (!(providerType in accountTokens[selectedAddress])) accountTokens[selectedAddress][providerType] = [] accountTokens[selectedAddress][providerType] = tokens this.store.updateState({ accountTokens, tokens }) } |