aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers/preferences.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-06-06 02:51:27 +0800
committerkumavis <aaron@kumavis.me>2018-06-06 02:51:27 +0800
commit20bdba3d1710a070d06c2a395f92d948b9396d47 (patch)
tree2eef359c3e3c3959339f043eb3c99a6b83b27dec /app/scripts/controllers/preferences.js
parent6247e54fcc11d4d8d857a977d00eee8012afb92f (diff)
downloadtangerine-wallet-browser-20bdba3d1710a070d06c2a395f92d948b9396d47.tar
tangerine-wallet-browser-20bdba3d1710a070d06c2a395f92d948b9396d47.tar.gz
tangerine-wallet-browser-20bdba3d1710a070d06c2a395f92d948b9396d47.tar.bz2
tangerine-wallet-browser-20bdba3d1710a070d06c2a395f92d948b9396d47.tar.lz
tangerine-wallet-browser-20bdba3d1710a070d06c2a395f92d948b9396d47.tar.xz
tangerine-wallet-browser-20bdba3d1710a070d06c2a395f92d948b9396d47.tar.zst
tangerine-wallet-browser-20bdba3d1710a070d06c2a395f92d948b9396d47.zip
diagnostics - rewrite bug-notifier as diagnostics-reporter
Diffstat (limited to 'app/scripts/controllers/preferences.js')
-rw-r--r--app/scripts/controllers/preferences.js19
1 files changed, 4 insertions, 15 deletions
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index 2fe009f9a..a5d8cc27b 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -1,9 +1,7 @@
const ObservableStore = require('obs-store')
const normalizeAddress = require('eth-sig-util').normalize
const extend = require('xtend')
-const notifier = require('../lib/bug-notifier')
-const log = require('loglevel')
-const { version } = require('../../manifest.json')
+
class PreferencesController {
@@ -34,8 +32,7 @@ class PreferencesController {
lostIdentities: {},
}, opts.initState)
- this.getFirstTimeInfo = opts.getFirstTimeInfo || null
- this.notifier = opts.notifier || notifier
+ this.diagnostics = opts.diagnostics
this.store = new ObservableStore(initState)
}
@@ -128,17 +125,9 @@ class PreferencesController {
if (Object.keys(newlyLost).length > 0) {
// Notify our servers:
- const uri = 'https://diagnostics.metamask.io/v1/orphanedAccounts'
- const firstTimeInfo = this.getFirstTimeInfo ? this.getFirstTimeInfo() : {}
- this.notifier.notify(uri, {
- accounts: Object.keys(newlyLost),
- metadata: {
- version,
- firstTimeInfo,
- },
- })
- .catch(log.error)
+ if (this.diagnostics) this.diagnostics.reportOrphans(newlyLost)
+ // store lost accounts
for (let key in newlyLost) {
lostIdentities[key] = newlyLost[key]
}