From dfdcbb948aa2440efc2425569dce947c9cb00378 Mon Sep 17 00:00:00 2001 From: Poslovitch Date: Sat, 24 Apr 2021 12:04:48 +0000 Subject: Fixed "previous" button showing when not watching a playlist --- client/src/app/+videos/+video-watch/video-watch.component.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'client/src') 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 1f24c898e..025c62430 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts @@ -799,10 +799,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy { common: { autoplay: this.isAutoplay(), nextVideo: () => this.zone.run(() => this.autoplayNext()), - previousVideo: () => this.zone.run(() => { - // FIXME: Only show if this is a playlist - if (this.playlist) this.zone.run(() => this.videoWatchPlaylist.navigateToPreviousPlaylistVideo()) - }), playerElement: this.playerElement, onPlayerElementChange: (element: HTMLVideoElement) => this.playerElement = element, @@ -851,6 +847,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy { } } + // Only set this if we're in a playlist + if (this.playlist) options.common.previousVideo = () => { + this.zone.run(() => this.videoWatchPlaylist.navigateToPreviousPlaylistVideo()) + } + let mode: PlayerMode if (urlOptions.playerMode) { -- cgit v1.2.3