From 54453fea346de5a1546f8c469163bd0c7ae37f7c Mon Sep 17 00:00:00 2001 From: Marco Realacci Date: Thu, 22 Dec 2022 18:22:37 +0100 Subject: [PATCH] Fix show more button in comments not re-appearing when posting a new comment --- webui/src/components/PostCard.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webui/src/components/PostCard.vue b/webui/src/components/PostCard.vue index bf2bd85..1d3fdb8 100644 --- a/webui/src/components/PostCard.vue +++ b/webui/src/components/PostCard.vue @@ -12,6 +12,7 @@ export default { comments_start_idx: 0, comments_shown: false, commentMsg: "", + data_ended: false, } }, methods: { @@ -42,12 +43,14 @@ export default { this.getComments(); }, getComments() { + this.data_ended = false + // Get comments from the server this.$axios.get("/users/" + this.user_id + "/photos/" + this.photo_id + - "/comments?limit=2&start_index=" + this.comments_start_idx).then(response => { + "/comments?limit=5&start_index=" + this.comments_start_idx).then(response => { if (response.data.length == 0) this.data_ended = true; - else this.comments_start_idx += 2; + else this.comments_start_idx += 5; this.comments_data = this.comments_data.concat(response.data); this.comments_shown = true;