diff --git a/src/components/Menu.vue b/src/components/Menu.vue index dbe088d..e832597 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -117,7 +117,7 @@ const { page } = storeToRefs(usePageStore()); const unreadNotificationsCount = computed(() => { if (!user.value) return undefined; const count = user.value.notifications.filter( - (notification) => notification.isread + (notification) => notification.isread != "true" ).length; if (count === 0) return undefined; return count; @@ -164,7 +164,7 @@ function hasUnreadNotification(project) { if (!user.value) return false; return user.value.notifications.some((notification) => { return ( - notification.isread != true && + notification.isread != "true" && project.uri.includes(notification.location.project.uri) ); }); diff --git a/src/components/comments/Comment.vue b/src/components/comments/Comment.vue index e5d485c..4158934 100644 --- a/src/components/comments/Comment.vue +++ b/src/components/comments/Comment.vue @@ -2,7 +2,7 @@
@@ -70,11 +70,11 @@ const api = useApiStore(); const dialog = useDialogStore(); // Functions -const status = computed(() => { +const getStatus = computed(() => { const correspondingNotification = userStore.notifications.find( (notification) => notification.id === comment.id ); - if (correspondingNotification && !correspondingNotification.isread) { + if (correspondingNotification && correspondingNotification.isread != "true") { return "unread"; } return undefined; @@ -101,9 +101,10 @@ function closeAddField() { } async function read() { - if (status.value !== "unread") return; + if (getStatus.value !== "unread") return; try { const newNotification = await api.readNotification(comment.id); + console.log(newNotification); userStore.readNotification(comment.id); } catch (error) { console.log("Erreur lors de la lecture de la notification : ", error); diff --git a/src/components/notifications/Comment.vue b/src/components/notifications/Comment.vue index 31cfc42..3e66618 100644 --- a/src/components/notifications/Comment.vue +++ b/src/components/notifications/Comment.vue @@ -1,7 +1,7 @@