aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2018-06-05 05:30:24 +0800
committerDan Finlay <dan@danfinlay.com>2018-06-05 05:30:24 +0800
commitd07c664b2c31469d84dd3c84a929b8d4ba552e8c (patch)
treea9a34cbcf11245feb60a37fa8cd18c1f718c063c
parentb858cc4b1bf13c7c813fe48bb0b12f9eb3cc4a0d (diff)
downloadtangerine-wallet-browser-d07c664b2c31469d84dd3c84a929b8d4ba552e8c.tar
tangerine-wallet-browser-d07c664b2c31469d84dd3c84a929b8d4ba552e8c.tar.gz
tangerine-wallet-browser-d07c664b2c31469d84dd3c84a929b8d4ba552e8c.tar.bz2
tangerine-wallet-browser-d07c664b2c31469d84dd3c84a929b8d4ba552e8c.tar.lz
tangerine-wallet-browser-d07c664b2c31469d84dd3c84a929b8d4ba552e8c.tar.xz
tangerine-wallet-browser-d07c664b2c31469d84dd3c84a929b8d4ba552e8c.tar.zst
tangerine-wallet-browser-d07c664b2c31469d84dd3c84a929b8d4ba552e8c.zip
Fine tune error posting
-rw-r--r--app/scripts/controllers/preferences.js2
-rw-r--r--app/scripts/lib/bug-notifier.js6
2 files changed, 2 insertions, 6 deletions
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index 038bab37b..18254af4b 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -130,7 +130,7 @@ class PreferencesController {
// Notify our servers:
const uri = 'https://diagnostics.metamask.io/v1/orphanedAccounts'
- notifier.notify(uri, { accounts: Object.keys(lostIdentities) })
+ notifier.notify(uri, { accounts: Object.keys(newlyLost) })
.catch(log.error)
for (let key in newlyLost) {
diff --git a/app/scripts/lib/bug-notifier.js b/app/scripts/lib/bug-notifier.js
index d6a2ed2c9..42f943485 100644
--- a/app/scripts/lib/bug-notifier.js
+++ b/app/scripts/lib/bug-notifier.js
@@ -1,14 +1,11 @@
class BugNotifier {
notify (uri, message) {
return postData(uri, message)
- .then(data => console.log(data)) // JSON from `response.json()` call
- .catch(error => console.error(error))
}
}
function postData(uri, data) {
-
- return fetch(url, {
+ return fetch(uri, {
body: JSON.stringify(data), // must match 'Content-Type' header
credentials: 'same-origin', // include, same-origin, *omit
headers: {
@@ -17,7 +14,6 @@ function postData(uri, data) {
method: 'POST', // *GET, POST, PUT, DELETE, etc.
mode: 'cors', // no-cors, cors, *same-origin
})
- .then(response => response.json()) // parses response to JSON
}
module.exports = BugNotifier