fix warn
This commit is contained in:
parent
d0c973d842
commit
05bde9b24e
|
@ -59,17 +59,17 @@ self.addEventListener('push', ev => {
|
||||||
|
|
||||||
case 'readAllNotifications':
|
case 'readAllNotifications':
|
||||||
for (const n of await self.registration.getNotifications()) {
|
for (const n of await self.registration.getNotifications()) {
|
||||||
if (n.data.type === 'notification') n.close();
|
if (n?.data?.type === 'notification') n.close();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'readAllMessagingMessages':
|
case 'readAllMessagingMessages':
|
||||||
for (const n of await self.registration.getNotifications()) {
|
for (const n of await self.registration.getNotifications()) {
|
||||||
if (n.data.type === 'unreadMessagingMessage') n.close();
|
if (n?.data?.type === 'unreadMessagingMessage') n.close();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'readNotifications':
|
case 'readNotifications':
|
||||||
for (const n of await self.registration.getNotifications()) {
|
for (const n of await self.registration.getNotifications()) {
|
||||||
if (data.body.notificationIds?.includes(n.data.body.id)) {
|
if (data.body?.notificationIds?.includes(n.data.body.id)) {
|
||||||
n.close();
|
n.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue