Remove unnecessary await in push handler

We were `await`ing a synchronous method here, which will have the effect
of deferring its execution, and thus also the `event.waitUntil` call. We
want the latter to happen before control returns from the event.
Removing the unnecessary `await` solves this.

This seems unlikely to be a problem in practice, but all the same, it's
not right :)
This commit is contained in:
Kevin McConnell
2026-01-23 11:59:27 +00:00
parent 23fe40fa81
commit d7c9c4f3b0
+2 -2
View File
@@ -9,8 +9,8 @@ self.addEventListener('fetch', (event) => {
}
})
self.addEventListener("push", async (event) => {
const data = await event.data.json()
self.addEventListener("push", (event) => {
const data = event.data.json()
event.waitUntil(Promise.all([ showNotification(data), updateBadgeCount(data.options) ]))
})