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) {