Skip to content
Snippets Groups Projects
Commit 471b836a authored by tamaina's avatar tamaina
Browse files

fix(sw): 通知全削除時にread_notification通知が消えないように

通知欄に現れたり消えたりするとうざい
parent aa289c9c
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment