aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2018-06-05 05:05:56 +0800
committerDan Finlay <dan@danfinlay.com>2018-06-05 05:05:56 +0800
commit8fcaa2cf56936388ef8dfc528ecbd2354adb201e (patch)
tree3b3de0b1fdbd0b66f46483bdc1be0040f89c7ea1 /app/scripts/controllers
parentf5d4acf53b2d518df1b2c0b9b983bbc5224fb670 (diff)
downloadtangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.tar
tangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.tar.gz
tangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.tar.bz2
tangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.tar.lz
tangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.tar.xz
tangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.tar.zst
tangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.zip
Persist lost identities to storage for later analysis
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r--app/scripts/controllers/preferences.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index 8cb846476..38e93dea8 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -28,6 +28,7 @@ class PreferencesController {
featureFlags: {},
currentLocale: opts.initLangCode,
identities: {},
+ lostIdentities: {},
}, opts.initState)
this.store = new ObservableStore(initState)
}
@@ -106,18 +107,19 @@ class PreferencesController {
* @returns {Promise<string>} selectedAddress the selected address.
*/
syncAddresses (addresses) {
- const identities = this.store.getState().identities
+ let { identities, lostIdentities } = this.store.getState()
Object.keys(identities).forEach((identity) => {
if (!addresses.includes(identity)) {
delete identities[identity]
+ lostIdentities[identity] = identities[identity]
// TODO: Report the bug to Sentry including the now-lost identity.
alert('Error 4486: MetaMask has encountered a very strange error. Please open a support issue immediately at support@metamask.io.')
}
})
- this.store.updateState({ identities })
+ this.store.updateState({ identities, lostIdentities })
this.addAddresses(addresses)
let selected = this.getSelectedAddress()