if (!this.commentTree) {
this.commentTree = {
comment: this.comment,
+ hasDisplayedChildren: false,
children: []
}
this.commentTree.children.unshift({
comment: createdComment,
+ hasDisplayedChildren: false,
children: []
})
($event.target as HTMLImageElement).src = Account.GET_DEFAULT_AVATAR_URL()
}
- isNotDeletedOrDeletedWithReplies () {
- return !this.comment.isDeleted || this.comment.isDeleted && this.comment.totalReplies !== 0
+ isCommentDisplayed () {
+ // Not deleted
+ return !this.comment.isDeleted ||
+ this.comment.totalReplies !== 0 || // Or root comment thread has replies
+ (this.commentTree?.hasDisplayedChildren) // Or this is a reply that have other replies
}
private getUserIfNeeded (account: Account) {