]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fixed "previous" button showing when not watching a playlist
authorPoslovitch <poslovitch@bentobox.world>
Sat, 24 Apr 2021 12:04:48 +0000 (12:04 +0000)
committerChocobozzz <chocobozzz@cpy.re>
Mon, 26 Apr 2021 08:54:02 +0000 (10:54 +0200)
client/src/app/+videos/+video-watch/video-watch.component.ts

index 1f24c898e31965054dfd54e2322ecbbb5d5a49b4..025c62430c5134a2647f1da5da23863c4f0b92b0 100644 (file)
@@ -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) {