+
+ private deleteLocalCommentThread (parentComment: VideoCommentThreadTree, commentToDelete: VideoComment) {
+ for (const commentChild of parentComment.children) {
+ if (commentChild.comment.id === commentToDelete.id) {
+ parentComment.children = parentComment.children.filter(c => c.comment.id !== commentToDelete.id)
+ return
+ }
+
+ this.deleteLocalCommentThread(commentChild, commentToDelete)
+ }
+ }
+
+ private resetVideo () {
+ if (this.video.commentsEnabled === true) {
+ // Reset all our fields
+ this.highlightedComment = null
+ this.comments = []
+ this.threadComments = {}
+ this.threadLoading = {}
+ this.inReplyToCommentId = undefined
+ this.componentPagination.currentPage = 1
+ this.componentPagination.totalItems = null
+
+ this.loadMoreComments()
+ }
+ }
+
+ private processHighlightedComment (highlightedCommentId: number) {
+ this.highlightedComment = this.comments.find(c => c.id === highlightedCommentId)
+
+ const highlightComment = true
+ this.viewReplies(highlightedCommentId, highlightComment)
+ }