diff --git a/packages/sw/src/sw.ts b/packages/sw/src/sw.ts index 9e0d9f0d1..2783f2bfb 100644 --- a/packages/sw/src/sw.ts +++ b/packages/sw/src/sw.ts @@ -56,7 +56,7 @@ globalThis.addEventListener('push', ev => { return createNotification(data); case 'readAllNotifications': await globalThis.registration.getNotifications() - .then(notifications => notifications.forEach(n => n.close())); + .then(notifications => notifications.forEach(n => n.tag !== 'read_notification' && n.close())); break; } @@ -133,7 +133,7 @@ globalThis.addEventListener('notificationclick', (ev: ServiceWorkerGlobalScopeEv switch (action) { case 'markAllAsRead': await globalThis.registration.getNotifications() - .then(notifications => notifications.forEach(n => n.close())); + .then(notifications => notifications.forEach(n => n.tag !== 'read_notification' && n.close())); await get('accounts').then(accounts => { return Promise.all(accounts.map(async account => { await swos.sendMarkAllAsRead(account.id);