fix(service-worker): Make API call to the right endpoint (#1664)

Closes #1663.
This commit is contained in:
Sorin Davidoi 2019-12-08 18:56:23 +01:00 committed by Nolan Lawson
parent c071ac1174
commit 5f51bd5aad

View file

@ -169,7 +169,7 @@ self.addEventListener('fetch', event => {
self.addEventListener('push', event => { self.addEventListener('push', event => {
event.waitUntil((async () => { event.waitUntil((async () => {
const data = event.data.json() const data = event.data.json()
const { origin } = new URL(data.icon) const { origin } = event.target
try { try {
const notification = await get(`${origin}/api/v1/notifications/${data.notification_id}`, { const notification = await get(`${origin}/api/v1/notifications/${data.notification_id}`, {