From 3c364ae1941a4a0ecb6e630eb9cb538067216b70 Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Sun, 6 Feb 2022 14:38:17 -0500 Subject: [PATCH] don't repeat comments (#1986) --- .../watch-video-comments/watch-video-comments.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/watch-video-comments/watch-video-comments.js b/src/renderer/components/watch-video-comments/watch-video-comments.js index 49101feb..a022da53 100644 --- a/src/renderer/components/watch-video-comments/watch-video-comments.js +++ b/src/renderer/components/watch-video-comments/watch-video-comments.js @@ -274,9 +274,13 @@ export default Vue.extend({ }) if (index !== null) { - this.commentData[index].replies = this.commentData[index].replies.concat(commentData) - this.commentData[index].replyToken = response.continuation - this.commentData[index].showReplies = true + if (this.commentData[index].replies.length === 0 || this.commentData[index].replies[this.commentData[index].replies.length - 1].commentId !== commentData[commentData.length - 1].commentId) { + this.commentData[index].replies = this.commentData[index].replies.concat(commentData) + this.commentData[index].replyToken = response.continuation + this.commentData[index].showReplies = true + } else { + console.log('Don\'t display comments twice') + } } else { if (this.sortingChanged) { this.commentData = []