File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
src/renderer/components/WatchVideoPlaylist Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -667,7 +667,6 @@ async function getPlaylistInformationInvidious() {
667667 getPlaylistInformationLocal ()
668668 } else {
669669 isLoading .value = false
670- // TODO: Show toast with error message
671670 }
672671 }
673672}
@@ -694,10 +693,10 @@ function shufflePlaylistItems() {
694693 // Prevents the array from affecting the original object
695694 const items = playlistItems .value .slice ()
696695
697- let cachedCurrentVideo
696+ let cachedCurrentVideos
698697
699698 if (currentVideo .value != null ) {
700- cachedCurrentVideo = items .splice (currentVideoIndexZeroBased .value , 1 )
699+ cachedCurrentVideos = items .splice (currentVideoIndexZeroBased .value , 1 )
701700 // There is no else case
702701 // If current video is absent in (removed from) the playlist, nothing should be changed
703702 }
@@ -710,8 +709,8 @@ function shufflePlaylistItems() {
710709 items[j] = temp
711710 }
712711
713- if (cachedCurrentVideo !== undefined ) {
714- items .unshift (cachedCurrentVideo )
712+ if (cachedCurrentVideos && cachedCurrentVideos . length > 0 ) {
713+ items .unshift (cachedCurrentVideos[ 0 ] )
715714 }
716715
717716 randomizedPlaylistItems .value = items
You can’t perform that action at this time.
0 commit comments