From 66b247875faafd2cdb2fced8a4f4be32d9593245 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Thu, 8 Aug 2019 05:38:38 +0200 Subject: [PATCH] fix(service-worker): Open notifications if no status (#1378) * fix(service-worker): Open notifications if no status If the notifications couldn't be fetched fallback to displaying all notifications (aligned with how the Mastodon Web UI [handles it](https://github.com/tootsuite/mastodon/blob/master/app/javascript/mastodon/service_worker/web_push_notifications.js#L118)). Might fix https://github.com/nolanlawson/pinafore/issues/1365. * fix(service-worker): Use self --- src/service-worker.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/service-worker.js b/src/service-worker.js index a473f389..ef348868 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -128,7 +128,10 @@ self.addEventListener('push', event => { async function showSimpleNotification (data) { await self.registration.showNotification(data.title, { icon: data.icon, - body: data.body + body: data.body, + data: { + url: `${self.origin}/notifications` + } }) }