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) {