aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-07 12:20:48 +0100
committerChocobozzz <me@florianbigard.com>2018-02-08 09:52:57 +0100
commit649fb0829a0735eae9938cdedd8573b5f4bc5100 (patch)
tree5e49f1bc9a0cd34158cdf1884afc547473acd0cb
parent588d837c87074c2c866423a8594f6841143ee50b (diff)
downloadPeerTube-649fb0829a0735eae9938cdedd8573b5f4bc5100.tar.gz
PeerTube-649fb0829a0735eae9938cdedd8573b5f4bc5100.tar.zst
PeerTube-649fb0829a0735eae9938cdedd8573b5f4bc5100.zip
Fix other videos not displayed in video watch
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts16
1 files changed, 12 insertions, 4 deletions
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts
index c9bdd4dfc..a281fff23 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -70,7 +70,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
70 ngOnInit () { 70 ngOnInit () {
71 this.videoService.getVideos({ currentPage: 1, itemsPerPage: 5 }, '-createdAt') 71 this.videoService.getVideos({ currentPage: 1, itemsPerPage: 5 }, '-createdAt')
72 .subscribe( 72 .subscribe(
73 data => this.otherVideos = data.videos, 73 data => {
74 this.otherVideos = data.videos
75 this.updateOtherVideosDisplayed()
76 },
77
74 err => console.error(err) 78 err => console.error(err)
75 ) 79 )
76 80
@@ -290,9 +294,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
290 private onVideoFetched (video: VideoDetails) { 294 private onVideoFetched (video: VideoDetails) {
291 this.video = video 295 this.video = video
292 296
293 if (this.otherVideos.length > 0) { 297 this.updateOtherVideosDisplayed()
294 this.otherVideosDisplayed = this.otherVideos.filter(v => v.uuid !== this.video.uuid)
295 }
296 298
297 let observable 299 let observable
298 if (this.video.isVideoNSFWForUser(this.user)) { 300 if (this.video.isVideoNSFWForUser(this.user)) {
@@ -402,6 +404,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
402 this.video.dislikes += dislikesToIncrement 404 this.video.dislikes += dislikesToIncrement
403 } 405 }
404 406
407 private updateOtherVideosDisplayed () {
408 if (this.otherVideos.length > 0) {
409 this.otherVideosDisplayed = this.otherVideos.filter(v => v.uuid !== this.video.uuid)
410 }
411 }
412
405 private setOpenGraphTags () { 413 private setOpenGraphTags () {
406 this.metaService.setTitle(this.video.name) 414 this.metaService.setTitle(this.video.name)
407 415