aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-12-10 10:22:27 +0100
committerChocobozzz <me@florianbigard.com>2020-12-10 10:22:27 +0100
commit19b163d045750fe06ce04f601628d12085783d7b (patch)
tree5eac3be878a9fd8b3b02e35fd9a3a4c7c62fd135
parentdc1f314efdae14f838c109ebbc1e8d69273d0319 (diff)
downloadPeerTube-19b163d045750fe06ce04f601628d12085783d7b.tar.gz
PeerTube-19b163d045750fe06ce04f601628d12085783d7b.tar.zst
PeerTube-19b163d045750fe06ce04f601628d12085783d7b.zip
Fix comments count
-rw-r--r--client/src/app/+videos/+video-watch/comment/video-comments.component.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/src/app/+videos/+video-watch/comment/video-comments.component.ts b/client/src/app/+videos/+video-watch/comment/video-comments.component.ts
index a4c651da5..f83a73ccd 100644
--- a/client/src/app/+videos/+video-watch/comment/video-comments.component.ts
+++ b/client/src/app/+videos/+video-watch/comment/video-comments.component.ts
@@ -5,6 +5,7 @@ import { AuthService, ComponentPagination, ConfirmService, hasMoreItems, Notifie
5import { HooksService } from '@app/core/plugins/hooks.service' 5import { HooksService } from '@app/core/plugins/hooks.service'
6import { Syndication, VideoDetails } from '@app/shared/shared-main' 6import { Syndication, VideoDetails } from '@app/shared/shared-main'
7import { VideoComment, VideoCommentService, VideoCommentThreadTree } from '@app/shared/shared-video-comment' 7import { VideoComment, VideoCommentService, VideoCommentThreadTree } from '@app/shared/shared-video-comment'
8import { ThisReceiver } from '@angular/compiler'
8 9
9@Component({ 10@Component({
10 selector: 'my-video-comments', 11 selector: 'my-video-comments',
@@ -121,7 +122,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
121 obs.subscribe( 122 obs.subscribe(
122 res => { 123 res => {
123 this.comments = this.comments.concat(res.data) 124 this.comments = this.comments.concat(res.data)
124 this.componentPagination.totalItems = res.total 125 // Client does not display removed comments
126 this.componentPagination.totalItems = res.total - this.comments.filter(c => c.isDeleted).length
125 127
126 this.onDataSubject.next(res.data) 128 this.onDataSubject.next(res.data)
127 this.hooks.runAction('action:video-watch.video-threads.loaded', 'video-watch', { data: this.componentPagination }) 129 this.hooks.runAction('action:video-watch.video-threads.loaded', 'video-watch', { data: this.componentPagination })