From 87589ee420900e959a34b25a5a98d1fceb4ea62e Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 24 Apr 2021 00:52:04 +0900 Subject: [PATCH] https://github.com/misskey-dev/misskey/pull/7129#discussion_r619297784 --- src/client/components/notifications.vue | 10 ++++++---- src/client/scripts/mark-notification-read.ts | 3 --- 2 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 src/client/scripts/mark-notification-read.ts diff --git a/src/client/components/notifications.vue b/src/client/components/notifications.vue index 39aea3b686..6027a39acc 100644 --- a/src/client/components/notifications.vue +++ b/src/client/components/notifications.vue @@ -92,18 +92,20 @@ export default defineComponent({ this.connection.on('notification', this.onNotification); this.connection.on('readAllNotifications', () => { - this.queue = this.queue.map(x => markNotificationRead(x)); + for (const item of this.queue) { + item.isRead = true; + } for (const item of this.items) { item.isRead = true; } }); this.connection.on('readNotifications', notificationIds => { - if (this.queue.length === 0) return; - for (let i = 0; i < this.queue.length; i++) { if (notificationIds.includes(this.queue[i].id)) { - this.queue[i] = markNotificationRead(this.queue[i]); + this.queue[i].isRead = true; } + } + for (let i = 0; i < this.items.length; i++) { if (notificationIds.includes(this.items[i].id)) { this.items[i].isRead = true; } diff --git a/src/client/scripts/mark-notification-read.ts b/src/client/scripts/mark-notification-read.ts deleted file mode 100644 index 229b3dbbdd..0000000000 --- a/src/client/scripts/mark-notification-read.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function markNotificationRead(notification: any) { - return { ...notification, isRead: true }; -}