From 8a1b1227113547583708dbd0c3b59c15c6a8e340 Mon Sep 17 00:00:00 2001 From: summersamara Date: Wed, 22 Nov 2023 16:45:43 +0100 Subject: [PATCH] remove unnecessary function --- src/views/Event/EventView.vue | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/views/Event/EventView.vue b/src/views/Event/EventView.vue index 15750628..ab32c301 100755 --- a/src/views/Event/EventView.vue +++ b/src/views/Event/EventView.vue @@ -612,17 +612,15 @@ const organizerDomain = computed((): string | undefined => { return organizer.value?.domain ?? undefined; }); -const filterNonPassedRelatedEvents = (relatedEvents: IEvent[] | undefined) => { - return relatedEvents?.filter((relatedEvent) => { +const nonPassedRelatedEvents = computed((): IEvent[] | undefined => { + let relatedEvents = event.value?.relatedEvents; + + return relatedEvents?.filter((relatedEvent: IEvent) => { const endsOn = relatedEvent.endsOn ? new Date(relatedEvent.endsOn) : new Date(relatedEvent.beginsOn); return endsOn > new Date(); }); -}; - -const nonPassedRelatedEvents = computed((): IEvent[] | undefined => { - return filterNonPassedRelatedEvents(event.value?.relatedEvents); }); useHead({