Close notification early

Not sure if this would make a difference but possibly fix some bugs
pull/261/head
Lim Chee Aun 2023-10-15 16:25:04 +08:00
rodzic 6540dd5642
commit 8cf30773ce
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -163,6 +163,7 @@ self.addEventListener('notificationclick', (event) => {
const { access_token, notification_type } = data;
const url = `/#/notifications?id=${tag}&access_token=${btoa(access_token)}`;
event.notification.close();
event.waitUntil(
(async () => {
const clients = await self.clients.matchAll({
@ -194,7 +195,6 @@ self.addEventListener('notificationclick', (event) => {
console.log('NOTIFICATION CLICK openWindow', url);
await self.clients.openWindow(url);
}
await event.notification.close();
})(),
);
});