]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/comment/video-comments.component.ts
Don't call watching endpoint if history is disabled
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / comment / video-comments.component.ts
index 3743cd22807cb4f92b624c395c4f068c330c3b37..8850eccd80213a4bb1e98e8324075e1b5be20ec5 100644 (file)
@@ -12,6 +12,7 @@ import { VideoDetails } from '../../../shared/video/video-details.model'
 import { VideoComment } from './video-comment.model'
 import { VideoCommentService } from './video-comment.service'
 import { I18n } from '@ngx-translate/i18n-polyfill'
+import { Syndication } from '@app/shared/video/syndication.model'
 
 @Component({
   selector: 'my-video-comments',
@@ -35,6 +36,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
   threadComments: { [ id: number ]: VideoCommentThreadTree } = {}
   threadLoading: { [ id: number ]: boolean } = {}
 
+  syndicationItems: Syndication[] = []
+
   private sub: Subscription
 
   constructor (
@@ -148,6 +151,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)
@@ -199,6 +204,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
       this.componentPagination.currentPage = 1
       this.componentPagination.totalItems = null
 
+      this.syndicationItems = this.videoCommentService.getVideoCommentsFeeds(this.video.uuid)
+
       this.loadMoreComments()
     }
   }