aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2018-06-05 05:21:46 +0800
committerDan Finlay <dan@danfinlay.com>2018-06-05 05:21:46 +0800
commitfd1ce4d741cc5992cc5d3d6109dc46cddf871ec2 (patch)
tree36eebb0cadf2434bbb18e64eb0b6a6abb9bfa35e /app/scripts/lib
parent8fcaa2cf56936388ef8dfc528ecbd2354adb201e (diff)
downloadtangerine-wallet-browser-fd1ce4d741cc5992cc5d3d6109dc46cddf871ec2.tar
tangerine-wallet-browser-fd1ce4d741cc5992cc5d3d6109dc46cddf871ec2.tar.gz
tangerine-wallet-browser-fd1ce4d741cc5992cc5d3d6109dc46cddf871ec2.tar.bz2
tangerine-wallet-browser-fd1ce4d741cc5992cc5d3d6109dc46cddf871ec2.tar.lz
tangerine-wallet-browser-fd1ce4d741cc5992cc5d3d6109dc46cddf871ec2.tar.xz
tangerine-wallet-browser-fd1ce4d741cc5992cc5d3d6109dc46cddf871ec2.tar.zst
tangerine-wallet-browser-fd1ce4d741cc5992cc5d3d6109dc46cddf871ec2.zip
Begin adding unconfigured notifier
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/bug-notifier.js (renamed from app/scripts/lib/4486-notifier.js)13
1 files changed, 4 insertions, 9 deletions
diff --git a/app/scripts/lib/4486-notifier.js b/app/scripts/lib/bug-notifier.js
index b1b153419..d6a2ed2c9 100644
--- a/app/scripts/lib/4486-notifier.js
+++ b/app/scripts/lib/bug-notifier.js
@@ -1,26 +1,21 @@
class BugNotifier {
- notify (message) {
-
- postData('http://example.com/answer', {answer: 42})
+ notify (uri, message) {
+ return postData(uri, message)
.then(data => console.log(data)) // JSON from `response.json()` call
.catch(error => console.error(error))
}
}
-function postData(url, data) {
- // Default options are marked with *
+function postData(uri, data) {
+
return fetch(url, {
body: JSON.stringify(data), // must match 'Content-Type' header
- cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'same-origin', // include, same-origin, *omit
headers: {
- 'user-agent': 'Mozilla/4.0 MDN Example',
'content-type': 'application/json'
},
method: 'POST', // *GET, POST, PUT, DELETE, etc.
mode: 'cors', // no-cors, cors, *same-origin
- redirect: 'follow', // manual, *follow, error
- referrer: 'no-referrer', // *client, no-referrer
})
.then(response => response.json()) // parses response to JSON
}