Use event.data instead of event in service worker subscription logic
Test / test (push) Failing after 53s
Details
Test / test (push) Failing after 53s
Details
This commit is contained in:
parent
e3a0b6e730
commit
fc043461a2
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue