comments working
This commit is contained in:
parent
375bed1d01
commit
0b472988a2
14 changed files with 107 additions and 59 deletions
|
|
@ -11,21 +11,21 @@ export const useUserStore = defineStore("user", () => {
|
|||
return projects.value.reduce((acc, project) => {
|
||||
if (!project.notifications) return acc;
|
||||
|
||||
const projectNotifications = project.notifications.map(
|
||||
(notification) => ({
|
||||
const projectNotifications = project.notifications.map((notification) => {
|
||||
const newNotification = {
|
||||
...notification,
|
||||
target: {
|
||||
uuid: project.uuid,
|
||||
title: project.title,
|
||||
slug: project.slug,
|
||||
},
|
||||
isRead:
|
||||
notification.author.uuid === user.value.uuid ||
|
||||
notification.readby?.includes(user.value.uuid),
|
||||
})
|
||||
project: project,
|
||||
isRead: notification.readby?.includes(user.value.uuid),
|
||||
};
|
||||
|
||||
return newNotification;
|
||||
});
|
||||
|
||||
const userNotifications = projectNotifications.filter(
|
||||
(notification) => notification.author.uuid !== user.value.uuid
|
||||
);
|
||||
|
||||
return [...acc, ...projectNotifications];
|
||||
return [...acc, ...userNotifications];
|
||||
}, []);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue