diff options
| author | Adam Soltys <[email protected]> | 2026-02-11 17:51:24 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-11 17:51:24 -0800 |
| commit | 13466248004327e9a026cb89f94926f9b060d1c1 (patch) | |
| tree | 47b4972c33809ccdf866b043c92cd3e0ecf5dcd0 /src/service-worker.js | |
| parent | 3aa9ce1b5985397d7f568887ec6f881df13c1034 (diff) | |
| download | coinos-ui-13466248004327e9a026cb89f94926f9b060d1c1.tar.gz coinos-ui-13466248004327e9a026cb89f94926f9b060d1c1.zip | |
linting
Diffstat (limited to 'src/service-worker.js')
| -rw-r--r-- | src/service-worker.js | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/src/service-worker.js b/src/service-worker.js index fa934333..383f62d0 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -1,37 +1,35 @@ -import { build, files, version } from "$service-worker"; - -self.addEventListener("install", (event) => {}); -self.addEventListener("activate", (event) => {}); -self.addEventListener("fetch", (event) => {}); +self.addEventListener("install", () => {}); +self.addEventListener("activate", () => {}); +self.addEventListener("fetch", () => {}); self.addEventListener("push", (event) => { - const { title, body, url } = event.data.json(); - const icon = "/images/icon.png"; - const badge = "/images/badge.png"; - self.registration.showNotification(title, { - body, - icon, - badge, - data: { url }, - }); + const { title, body, url } = event.data.json(); + const icon = "/images/icon.png"; + const badge = "/images/badge.png"; + self.registration.showNotification(title, { + body, + icon, + badge, + data: { url }, + }); }); self.addEventListener("notificationclick", (event) => { - event.notification.close(); + event.notification.close(); - const url = event.notification.data.url || "/"; + 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(); - } - } - if (clients.openWindow) { - return clients.openWindow(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(); + } + } + if (clients.openWindow) { + return clients.openWindow(url); + } + }), + ); }); |
