diff options
Diffstat (limited to 'client/src/app')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 16 |
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 | ||