From e32611c9687c66308bbbe32182a46555b83a8e49 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 25 Oct 2022 10:48:09 +0200 Subject: [PATCH] Fix showing past events on group page Closes #1172 Signed-off-by: Thomas Citharel --- js/src/views/Event/GroupEvents.vue | 2 +- js/src/views/Group/GroupView.vue | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/js/src/views/Event/GroupEvents.vue b/js/src/views/Event/GroupEvents.vue index fb3cc1c1..0d628c2e 100644 --- a/js/src/views/Event/GroupEvents.vue +++ b/js/src/views/Event/GroupEvents.vue @@ -123,7 +123,7 @@ const { result: membershipsResult } = useQuery<{ () => ({ enabled: currentActor.value?.id !== undefined }) ); const memberships = computed( - () => membershipsResult.value?.person.memberships.elements + () => membershipsResult.value?.person.memberships?.elements ); const route = useRoute(); diff --git a/js/src/views/Group/GroupView.vue b/js/src/views/Group/GroupView.vue index da4d9ef7..93a6c669 100644 --- a/js/src/views/Group/GroupView.vue +++ b/js/src/views/Group/GroupView.vue @@ -543,7 +543,7 @@ :to="{ name: RouteName.GROUP_EVENTS, params: { preferredUsername: usernameWithDomain(group) }, - query: { future: false }, + query: { showPassedEvents: true }, }" >{{ t("View past events") }} @@ -559,7 +559,9 @@ :to="{ name: RouteName.GROUP_EVENTS, params: { preferredUsername: usernameWithDomain(group) }, - query: { future: organizedEvents.elements.length > 0 }, + query: { + showPassedEvents: organizedEvents.elements.length === 0, + }, }" >{{ t("View all events") }} @@ -696,7 +698,7 @@ const { group, loading: groupLoading, refetch: refetchGroup, -} = useGroup(props.preferredUsername); +} = useGroup(props.preferredUsername, { afterDateTime: new Date() }); const router = useRouter(); const { t } = useI18n({ useScope: "global" });