mark as unread if comment is in notifications working

This commit is contained in:
isUnknown 2024-10-23 16:19:33 +02:00
parent b99f7c81dd
commit 65a2bbaa8d
4 changed files with 36 additions and 3 deletions

View file

@ -7,7 +7,7 @@
v-for="(comment, commentIndex) in Object.values(page)"
:key="pageIndex + commentIndex"
class="comment | flow"
data-status="unread"
:data-status="setStatus(comment)"
>
<header>
<p>
@ -131,4 +131,12 @@ function closeAddField() {
isAddOpen.value = false;
newCommentText.value = "";
}
function setStatus(comment) {
if (user?.notifications?.comments.hasOwnProperty(comment.id)) {
return "unread";
} else {
return undefined;
}
}
</script>