+
+ 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.highlightedThread = null
+ this.comments = []
+ this.threadComments = {}
+ this.threadLoading = {}
+ this.inReplyToCommentId = undefined
+ this.componentPagination.currentPage = 1
+ this.componentPagination.totalItems = null
+
+ this.loadMoreComments()
+ }
+ }
+
+ private processHighlightedThread (highlightedThreadId: number) {
+ this.highlightedThread = this.comments.find(c => c.id === highlightedThreadId)
+
+ const highlightThread = true
+ this.viewReplies(highlightedThreadId, highlightThread)
+ }