From 5f51bd5aad512087f6df07d05bf9573a12afce03 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Sun, 8 Dec 2019 18:56:23 +0100 Subject: [PATCH] fix(service-worker): Make API call to the right endpoint (#1664) Closes #1663. --- src/service-worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service-worker.js b/src/service-worker.js index e13c880a..d6f98b6d 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -169,7 +169,7 @@ self.addEventListener('fetch', event => { self.addEventListener('push', event => { event.waitUntil((async () => { const data = event.data.json() - const { origin } = new URL(data.icon) + const { origin } = event.target try { const notification = await get(`${origin}/api/v1/notifications/${data.notification_id}`, {