From 160e5fbdae4e072e915e7bfc208b6ae350a01320 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 11 Jun 2021 15:08:43 +0200 Subject: [PATCH] Fix discussions pagination Signed-off-by: Thomas Citharel --- js/src/components/Comment/CommentTree.vue | 6 +-- .../Discussion/DiscussionComment.vue | 7 +++- js/src/mixins/group.ts | 4 +- js/src/views/Discussions/Discussion.vue | 40 +++++++++++++------ 4 files changed, 38 insertions(+), 19 deletions(-) diff --git a/js/src/components/Comment/CommentTree.vue b/js/src/components/Comment/CommentTree.vue index 70a08c0b2..816e4073e 100644 --- a/js/src/components/Comment/CommentTree.vue +++ b/js/src/components/Comment/CommentTree.vue @@ -107,11 +107,7 @@ import { ApolloCache, FetchResult, InMemoryCache } from "@apollo/client/core"; eventUUID: this.event.uuid, }; }, - update(data) { - return data.event.comments.map( - (comment: IComment) => new CommentModel(comment) - ); - }, + update: (data) => data.event.comments, skip() { return !this.event.uuid; }, diff --git a/js/src/components/Discussion/DiscussionComment.vue b/js/src/components/Discussion/DiscussionComment.vue index 2cb6bc3b7..f4b990407 100644 --- a/js/src/components/Discussion/DiscussionComment.vue +++ b/js/src/components/Discussion/DiscussionComment.vue @@ -57,7 +57,12 @@

{{ diff --git a/js/src/mixins/group.ts b/js/src/mixins/group.ts index 26be0c3e2..c6e9f6024 100644 --- a/js/src/mixins/group.ts +++ b/js/src/mixins/group.ts @@ -15,6 +15,8 @@ import { import { MemberRole } from "@/types/enums"; import { Component, Vue } from "vue-property-decorator"; +const now = new Date(); + @Component({ apollo: { group: { @@ -24,7 +26,7 @@ import { Component, Vue } from "vue-property-decorator"; return { name: this.$route.params.preferredUsername, beforeDateTime: null, - afterDateTime: new Date(), + afterDateTime: now, }; }, skip() { diff --git a/js/src/views/Discussions/Discussion.vue b/js/src/views/Discussions/Discussion.vue index 12b506568..aa4999b6e 100644 --- a/js/src/views/Discussions/Discussion.vue +++ b/js/src/views/Discussions/Discussion.vue @@ -127,7 +127,6 @@