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
This commit is contained in:
Sorin Davidoi 2019-08-08 05:38:38 +02:00 committed by Nolan Lawson
parent b2d7fad435
commit 66b247875f
1 changed files with 4 additions and 1 deletions

View File

@ -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`
}
})
}