Use event.data instead of event in service worker subscription logic
Test / test (push) Failing after 53s Details

This commit is contained in:
Jeff 2024-10-12 17:18:15 -04:00
parent e3a0b6e730
commit fc043461a2
1 changed files with 4 additions and 4 deletions

View File

@ -57,15 +57,15 @@ export default function start(self: ServiceWorkerGlobalScope) {
}) })
if ( if (
"type" in event && "type" in event.data &&
event.type === "subscribed" && event.data.type === "subscribed" &&
"subscription" in event "subscription" in event.data
) { ) {
try { try {
await event.waitUntil( await event.waitUntil(
submitSubscription( submitSubscription(
self.registration, self.registration,
event.subscription as PushSubscription event.data.subscription as PushSubscription
) )
) )
} catch (e) { } catch (e) {