From fc043461a26244c7ada67ef2b407f91ab2488453 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 12 Oct 2024 17:18:15 -0400 Subject: [PATCH] Use event.data instead of event in service worker subscription logic --- app/worker.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/worker.ts b/app/worker.ts index 40c5981..3a59d03 100644 --- a/app/worker.ts +++ b/app/worker.ts @@ -57,15 +57,15 @@ export default function start(self: ServiceWorkerGlobalScope) { }) if ( - "type" in event && - event.type === "subscribed" && - "subscription" in event + "type" in event.data && + event.data.type === "subscribed" && + "subscription" in event.data ) { try { await event.waitUntil( submitSubscription( self.registration, - event.subscription as PushSubscription + event.data.subscription as PushSubscription ) ) } catch (e) {