ServiceWorker: drop empty push events
This commit is contained in:
parent
35c916293e
commit
7a14d56f9f
|
@ -134,7 +134,10 @@ const htmlToPlainText = (html: string): string =>
|
||||||
|
|
||||||
/** ServiceWorker `push` event callback. */
|
/** ServiceWorker `push` event callback. */
|
||||||
const handlePush = (event: PushEvent) => {
|
const handlePush = (event: PushEvent) => {
|
||||||
const { access_token, notification_id, preferred_locale, title, body, icon } = event.data?.json();
|
// If event has no data, stop here.
|
||||||
|
if (!event.data) return;
|
||||||
|
|
||||||
|
const { access_token, notification_id, preferred_locale, title, body, icon } = event.data.json();
|
||||||
|
|
||||||
// Placeholder until more information can be loaded
|
// Placeholder until more information can be loaded
|
||||||
event.waitUntil(
|
event.waitUntil(
|
||||||
|
|
Loading…
Reference in New Issue