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