diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2023-04-18 06:01:18 +0000 |
|---|---|---|
| committer | tamaina <tamaina@hotmail.co.jp> | 2023-04-18 06:01:18 +0000 |
| commit | 471b836a4450745929e738f05cb369f5e1377fbd (patch) | |
| tree | 153f7697618fe6293cc827b9a1356ed4235cac37 /packages/sw/src | |
| parent | use channels/my-favorites on deck/channel-column/setChannel (#10662) (diff) | |
| download | sharkey-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.ts | 4 |
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); |