diff --git a/frigate/comms/webpush.py b/frigate/comms/webpush.py index 2320692b3..273805f69 100644 --- a/frigate/comms/webpush.py +++ b/frigate/comms/webpush.py @@ -90,7 +90,7 @@ class WebPushClient(Communicator): # type: ignore[misc] title = f"{', '.join(sorted_objects).replace('_', ' ').title()}{' was' if state == 'end' else ''} detected in {', '.join(payload['after']['data']['zones']).replace('_', ' ').title()}" message = f"Detected on {payload['after']['camera'].replace('_', ' ').title()}" - direct_url = f"/review?id={reviewId}" + link = f"/review?id={reviewId}" image = f'{payload["after"]["thumb_path"].replace("/media/frigate", "")}' for pusher in self.web_pushers: @@ -101,7 +101,7 @@ class WebPushClient(Communicator): # type: ignore[misc] { "title": title, "message": message, - "direct_url": direct_url, + "link": link, "image": image, "id": reviewId, } diff --git a/web/public/images/maskable-badge.png b/web/public/images/maskable-badge.png index 93a0d561e..856f14223 100644 Binary files a/web/public/images/maskable-badge.png and b/web/public/images/maskable-badge.png differ diff --git a/web/public/notifications-worker.ts b/web/public/notifications-worker.js similarity index 88% rename from web/public/notifications-worker.ts rename to web/public/notifications-worker.js index 95b7fe72d..7bf0ab248 100644 --- a/web/public/notifications-worker.ts +++ b/web/public/notifications-worker.js @@ -28,10 +28,9 @@ self.addEventListener("notificationclick", (event) => { // @ts-expect-error we know this exists if (event.notification.data) { - // @ts-expect-error we know this exists const url = event.notification.data.link; - // @ts-expect-error we know this exists + // eslint-disable-next-line no-undef clients.matchAll({ type: "window" }).then((windowClients) => { // Check if there is already a window/tab open with the target URL for (let i = 0; i < windowClients.length; i++) { @@ -42,9 +41,9 @@ self.addEventListener("notificationclick", (event) => { } } // If not, then open the target URL in a new window/tab. - // @ts-expect-error we know this exists + // eslint-disable-next-line no-undef if (clients.openWindow) { - // @ts-expect-error we know this exists + // eslint-disable-next-line no-undef return clients.openWindow(url); } }); diff --git a/web/src/views/settings/NotificationsSettingsView.tsx b/web/src/views/settings/NotificationsSettingsView.tsx index 31492ceb2..ddcf7ed89 100644 --- a/web/src/views/settings/NotificationsSettingsView.tsx +++ b/web/src/views/settings/NotificationsSettingsView.tsx @@ -25,7 +25,7 @@ import { toast } from "sonner"; import useSWR from "swr"; import { z } from "zod"; -const NOTIFICATION_SERVICE_WORKER = "notifications-worker.ts"; +const NOTIFICATION_SERVICE_WORKER = "notifications-worker.js"; type NotificationSettingsValueType = { enabled: boolean; @@ -220,11 +220,11 @@ export default function NotificationView({ name="email" render={({ field }) => ( - Loitering Time + Email