diff options
Diffstat (limited to 'src/service-worker.js')
| -rw-r--r-- | src/service-worker.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/service-worker.js b/src/service-worker.js index 383f62d0..9d33d322 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -19,17 +19,15 @@ self.addEventListener("notificationclick", (event) => { const url = event.notification.data.url || "/"; event.waitUntil( - clients - .matchAll({ type: "window", includeUncontrolled: true }) - .then((clientList) => { - for (const client of clientList) { - if (client.url === url && "focus" in client) { - return client.focus(); - } + clients.matchAll({ type: "window", includeUncontrolled: true }).then((clientList) => { + for (const client of clientList) { + if (client.url === url && "focus" in client) { + return client.focus(); } - if (clients.openWindow) { - return clients.openWindow(url); - } - }), + } + if (clients.openWindow) { + return clients.openWindow(url); + } + }), ); }); |
