forked from AkkomaGang/akkoma-fe
ServiceWorker: Don't show message via sw if a client is active.
This commit is contained in:
parent
5b0190bef5
commit
e2ca107e01
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ const maybeShowNotification = async (event) => {
|
||||||
const enabled = await isEnabled()
|
const enabled = await isEnabled()
|
||||||
const activeClients = await getWindowClients()
|
const activeClients = await getWindowClients()
|
||||||
await setLocale()
|
await setLocale()
|
||||||
if (enabled && activeClients) {
|
if (enabled && (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}`
|
||||||
|
|
Loading…
Reference in a new issue