From 506a6dd4c74b116c3ab67fdf21d34d28f1233e14 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 22 Nov 2021 10:08:12 +0100 Subject: [PATCH] Avoid giving an error page if the apollo futureParticipations query is undefined Closes #932 Signed-off-by: Thomas Citharel --- js/src/views/Event/MyEvents.vue | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/js/src/views/Event/MyEvents.vue b/js/src/views/Event/MyEvents.vue index 0e63f483..bdf9285d 100644 --- a/js/src/views/Event/MyEvents.vue +++ b/js/src/views/Event/MyEvents.vue @@ -434,24 +434,28 @@ export default class MyEvents extends Vue { loadMoreFutureParticipations(): void { this.futurePage += 1; - this.$apollo.queries.futureParticipations.fetchMore({ - // New variables - variables: { - page: this.futurePage, - limit: this.limit, - }, - }); + if (this.$apollo.queries.futureParticipations) { + this.$apollo.queries.futureParticipations.fetchMore({ + // New variables + variables: { + page: this.futurePage, + limit: this.limit, + }, + }); + } } loadMorePastParticipations(): void { this.pastPage += 1; - this.$apollo.queries.pastParticipations.fetchMore({ - // New variables - variables: { - page: this.pastPage, - limit: this.limit, - }, - }); + if (this.$apollo.queries.pastParticipations) { + this.$apollo.queries.pastParticipations.fetchMore({ + // New variables + variables: { + page: this.pastPage, + limit: this.limit, + }, + }); + } } eventDeleted(eventid: string): void {