fuck youuuuuuuuuuuuuuuu
This commit is contained in:
parent
e0eaf961c4
commit
a3733eae60
1 changed files with 8 additions and 10 deletions
|
|
@ -59,10 +59,9 @@ const setSettings = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const showPushNotification = async (event) => {
|
const showPushNotification = async (event) => {
|
||||||
const activeClients = await getWindowClients()
|
// const activeClients = await getWindowClients()
|
||||||
await setSettings()
|
await setSettings()
|
||||||
// Only show push notifications if all tabs/windows are closed
|
// Only show push notifications if all tabs/windows are closed
|
||||||
if (activeClients.length === 0) {
|
|
||||||
const data = event.data.json()
|
const data = event.data.json()
|
||||||
|
|
||||||
const url = `${self.registration.scope}api/v1/notifications/${data.notification_id}`
|
const url = `${self.registration.scope}api/v1/notifications/${data.notification_id}`
|
||||||
|
|
@ -73,7 +72,6 @@ const showPushNotification = async (event) => {
|
||||||
const res = prepareNotificationObject(parsedNotification, i18n)
|
const res = prepareNotificationObject(parsedNotification, i18n)
|
||||||
|
|
||||||
return self.registration.showNotification(res.title, res)
|
return self.registration.showNotification(res.title, res)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.addEventListener('push', async (event) => {
|
self.addEventListener('push', async (event) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue