From 471b836a4450745929e738f05cb369f5e1377fbd Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 18 Apr 2023 06:01:18 +0000 Subject: [PATCH] =?UTF-8?q?fix(sw):=20=E9=80=9A=E7=9F=A5=E5=85=A8=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E6=99=82=E3=81=ABread=5Fnotification=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E3=81=8C=E6=B6=88=E3=81=88=E3=81=AA=E3=81=84=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=20=E9=80=9A=E7=9F=A5=E6=AC=84=E3=81=AB?= =?UTF-8?q?=E7=8F=BE=E3=82=8C=E3=81=9F=E3=82=8A=E6=B6=88=E3=81=88=E3=81=9F?= =?UTF-8?q?=E3=82=8A=E3=81=99=E3=82=8B=E3=81=A8=E3=81=86=E3=81=96=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sw/src/sw.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sw/src/sw.ts b/packages/sw/src/sw.ts index 9e0d9f0d1e..2783f2bfb5 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);