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 }; -}