- tree.comment = new VideoComment(tree.comment)
- tree.children.forEach(c => this.extractVideoCommentTree(c))
+ const tree = {
+ comment: new VideoComment(serverTree.comment),
+ children: serverTree.children.map(c => this.extractVideoCommentTree(c))
+ }
+
+ const hasDisplayedChildren = tree.children.length === 0
+ ? !tree.comment.isDeleted
+ : tree.children.some(c => c.hasDisplayedChildren)