]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/comment/video-comments.component.ts
Delete highlighted comment too if needed
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / comment / video-comments.component.ts
index 274c32d31b7126e005a985bb7b235f2c03883bb4..3707a40948d528294efda9d27b948b328f78d5f7 100644 (file)
@@ -83,7 +83,6 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
             // Scroll to the highlighted thread
             setTimeout(() => {
               // -60 because of the fixed header
-              console.log(this.commentHighlightBlock.nativeElement.offsetTop)
               const scrollY = this.commentHighlightBlock.nativeElement.offsetTop - 60
               window.scroll(0, scrollY)
             }, 500)
@@ -149,6 +148,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
           // Delete the thread
           this.comments = this.comments.filter(c => c.id !== commentToDelete.id)
           this.componentPagination.totalItems--
+
+          if (this.highlightedThread.id === commentToDelete.id) this.highlightedThread = undefined
         },
 
         err => this.notificationsService.error(this.i18n('Error'), err.message)