aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/comment/video-comment.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+videos/+video-watch/comment/video-comment.component.ts')
-rw-r--r--client/src/app/+videos/+video-watch/comment/video-comment.component.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/app/+videos/+video-watch/comment/video-comment.component.ts b/client/src/app/+videos/+video-watch/comment/video-comment.component.ts
index 0958b25c0..5c5d72b22 100644
--- a/client/src/app/+videos/+video-watch/comment/video-comment.component.ts
+++ b/client/src/app/+videos/+video-watch/comment/video-comment.component.ts
@@ -62,6 +62,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {
62 if (!this.commentTree) { 62 if (!this.commentTree) {
63 this.commentTree = { 63 this.commentTree = {
64 comment: this.comment, 64 comment: this.comment,
65 hasDisplayedChildren: false,
65 children: [] 66 children: []
66 } 67 }
67 68
@@ -70,6 +71,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {
70 71
71 this.commentTree.children.unshift({ 72 this.commentTree.children.unshift({
72 comment: createdComment, 73 comment: createdComment,
74 hasDisplayedChildren: false,
73 children: [] 75 children: []
74 }) 76 })
75 77
@@ -133,8 +135,11 @@ export class VideoCommentComponent implements OnInit, OnChanges {
133 ($event.target as HTMLImageElement).src = Account.GET_DEFAULT_AVATAR_URL() 135 ($event.target as HTMLImageElement).src = Account.GET_DEFAULT_AVATAR_URL()
134 } 136 }
135 137
136 isNotDeletedOrDeletedWithReplies () { 138 isCommentDisplayed () {
137 return !this.comment.isDeleted || this.comment.isDeleted && this.comment.totalReplies !== 0 139 // Not deleted
140 return !this.comment.isDeleted ||
141 this.comment.totalReplies !== 0 || // Or root comment thread has replies
142 (this.commentTree?.hasDisplayedChildren) // Or this is a reply that have other replies
138 } 143 }
139 144
140 private getUserIfNeeded (account: Account) { 145 private getUserIfNeeded (account: Account) {