]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/standalone/videos/shared/playlist-tracker.ts
Fix client lint
[github/Chocobozzz/PeerTube.git] / client / src / standalone / videos / shared / playlist-tracker.ts
index 9ea4be83f466c00bbfd6fdf23b8413602117438e..d8708826d1d14e9c18adae82792dfe97a3ff6150 100644 (file)
@@ -32,7 +32,7 @@ export class PlaylistTracker {
 
     const next = this.playlistElements.find(e => e.position === position)
 
-    if (!next || !next.video) {
+    if (!next?.video) {
       return this.getNextPlaylistElement(position + 1)
     }
 
@@ -52,7 +52,7 @@ export class PlaylistTracker {
 
     const prev = this.playlistElements.find(e => e.position === position)
 
-    if (!prev || !prev.video) {
+    if (!prev?.video) {
       return this.getNextPlaylistElement(position - 1)
     }
 
@@ -68,7 +68,7 @@ export class PlaylistTracker {
 
   setPosition (position: number) {
     this.currentPlaylistElement = this.playlistElements.find(e => e.position === position)
-    if (!this.currentPlaylistElement || !this.currentPlaylistElement.video) {
+    if (!this.currentPlaylistElement?.video) {
       logger.error('Current playlist element is not valid.', this.currentPlaylistElement)
       this.currentPlaylistElement = this.getNextPlaylistElement()
     }