diff options
| author | lain <lain@soykaf.club> | 2020-06-11 15:24:01 +0200 |
|---|---|---|
| committer | lain <lain@soykaf.club> | 2020-06-11 15:26:52 +0200 |
| commit | e2ca107e01c5a0715aa1a1a68496fe514eb9e902 (patch) | |
| tree | 35940a1738d505bfdc53c0665bd0169f15689a50 /src/sw.js | |
| parent | 5b0190bef5a9756453d0220b80a18469639c8fe9 (diff) | |
ServiceWorker: Don't show message via sw if a client is active.
Diffstat (limited to 'src/sw.js')
| -rw-r--r-- | src/sw.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -64,7 +64,7 @@ const maybeShowNotification = async (event) => { const enabled = await isEnabled() const activeClients = await getWindowClients() await setLocale() - if (enabled && activeClients) { + if (enabled && (activeClients.length === 0)) { const data = event.data.json() const url = `${self.registration.scope}api/v1/notifications/${data.notification_id}` |
