]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/comment/video-comments.component.ts
Fix add comment in threads with deleted comments
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / comment / video-comments.component.ts
index ba59e0a1d514843cf6d616b5731b9892c8a2a962..f1408effb38ca34f9b903a1b9aae49a3d67302d7 100644 (file)
@@ -96,6 +96,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
         res => {
           this.threadComments[commentId] = res
           this.threadLoading[commentId] = false
+          this.hooks.runAction('action:video-watch.video-thread-replies.loaded', 'video-watch', { data: res })
 
           if (highlightThread) {
             this.highlightedThread = new VideoComment(res.comment)
@@ -182,7 +183,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
           // Mark the comment as deleted
           this.softDeleteComment(commentToDelete)
 
-          if (this.highlightedThread.id === commentToDelete.id) this.highlightedThread = undefined
+          if (this.highlightedThread?.id === commentToDelete.id) this.highlightedThread = undefined
         },
 
         err => this.notifier.error(err.message)