summaryrefslogtreecommitdiff
path: root/packages/sw/src
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2023-04-18 06:01:18 +0000
committertamaina <tamaina@hotmail.co.jp>2023-04-18 06:01:18 +0000
commit471b836a4450745929e738f05cb369f5e1377fbd (patch)
tree153f7697618fe6293cc827b9a1356ed4235cac37 /packages/sw/src
parentuse channels/my-favorites on deck/channel-column/setChannel (#10662) (diff)
downloadsharkey-471b836a4450745929e738f05cb369f5e1377fbd.tar.gz
sharkey-471b836a4450745929e738f05cb369f5e1377fbd.tar.bz2
sharkey-471b836a4450745929e738f05cb369f5e1377fbd.zip
fix(sw): 通知全削除時にread_notification通知が消えないように
通知欄に現れたり消えたりするとうざい
Diffstat (limited to 'packages/sw/src')
-rw-r--r--packages/sw/src/sw.ts4
1 files 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);