fix(announcements): make sure only valid announcements are shown to the user

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2024-01-05 17:51:41 +01:00
parent dcbb8eae01
commit c9a1c35aa7
8 changed files with 95 additions and 4 deletions

View File

@@ -14,7 +14,11 @@
]"
/>
<div
v-if="conversation.event && !isCurrentActorAuthor"
v-if="
conversation.event &&
!isCurrentActorAuthor &&
isOriginCommentAuthorEventOrganizer
"
class="bg-mbz-yellow p-6 mb-3 rounded flex gap-2 items-center"
>
<Calendar :size="36" />
@@ -132,7 +136,11 @@
>
</form>
<div
v-else-if="conversation.event"
v-else-if="
conversation.event &&
!isCurrentActorAuthor &&
isOriginCommentAuthorEventOrganizer
"
class="bg-mbz-yellow p-6 rounded flex gap-2 items-center mt-3"
>
<Calendar :size="36" />
@@ -292,6 +300,16 @@ const isCurrentActorAuthor = computed(
currentActor.value.id !== conversation.value?.actor?.id
);
const isOriginCommentAuthorEventOrganizer = computed(
() =>
conversation.value?.originComment?.actor &&
conversation.value?.event &&
[
conversation.value?.event?.organizerActor?.id,
conversation.value?.event?.attributedTo?.id,
].includes(conversation.value?.originComment?.actor.id)
);
useHead({
title: () => title.value,
});