From 13466248004327e9a026cb89f94926f9b060d1c1 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 11 Feb 2026 17:51:24 -0800 Subject: linting --- src/service-worker.js | 58 +++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 30 deletions(-) (limited to 'src/service-worker.js') 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); + } + }), + ); }); -- cgit v1.2.3