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:
parent
b2d7fad435
commit
66b247875f
|
@ -128,7 +128,10 @@ self.addEventListener('push', event => {
|
||||||
async function showSimpleNotification (data) {
|
async function showSimpleNotification (data) {
|
||||||
await self.registration.showNotification(data.title, {
|
await self.registration.showNotification(data.title, {
|
||||||
icon: data.icon,
|
icon: data.icon,
|
||||||
body: data.body
|
body: data.body,
|
||||||
|
data: {
|
||||||
|
url: `${self.origin}/notifications`
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue