From f582bf847abd249042b47e0e62250e3ec24cb4c1 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 15 Jan 2025 15:09:58 +0100 Subject: [PATCH] adapt readAllNotifications --- src/stores/user.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/stores/user.js b/src/stores/user.js index 8b43db6..6e9491f 100644 --- a/src/stores/user.js +++ b/src/stores/user.js @@ -41,9 +41,13 @@ export const useUserStore = defineStore("user", () => { } function readAllNotifications(notificationId) { - user.value.notifications.forEach((notification) => { - notification.isRead = true; - }); + projects.value = projects.value.map((project) => ({ + ...project, + notifications: project.notifications.map((notification) => ({ + ...notification, + readby: [...new Set([...notification.readby, user.value.uuid])], + })), + })); } function canEditComment(comment) {