don't repeat comments (#1986)

This commit is contained in:
ChunkyProgrammer 2022-02-06 14:38:17 -05:00 committed by GitHub
parent d21a7f1c24
commit 3c364ae194
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -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 = []