Fix accessing group event unlogged

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-02-05 14:45:39 +01:00
parent 8ce3cccfa4
commit 6a063cf655
3 changed files with 14 additions and 20 deletions

View File

@@ -296,11 +296,9 @@ export default class Comment extends Vue {
}
get commentFromOrganizer(): boolean {
return (
this.event.organizerActor !== undefined &&
this.comment.actor != null &&
this.comment.actor.id === this.event.organizerActor.id
);
const organizerId =
this.event?.organizerActor?.id || this.event?.attributedTo?.id;
return organizerId !== undefined && this.comment?.actor?.id === organizerId;
}
get commentId(): string {

View File

@@ -320,11 +320,9 @@ export default class CommentTree extends Vue {
}
get isEventOrganiser(): boolean {
return (
this.currentActor.id !== undefined &&
this.event.organizerActor !== undefined &&
this.currentActor.id === this.event.organizerActor.id
);
const organizerId =
this.event?.organizerActor?.id || this.event?.attributedTo?.id;
return organizerId !== undefined && this.currentActor?.id === organizerId;
}
get areCommentsClosed(): boolean {
@@ -335,7 +333,7 @@ export default class CommentTree extends Vue {
}
get isAbleToComment(): boolean {
if (this.currentActor && this.currentActor.id) {
if (this.currentActor?.id) {
return this.areCommentsClosed || this.isEventOrganiser;
}
return false;