[bugfix]: fix repeat one with shuffle and one track

This commit is contained in:
Kendall Garner 2024-01-28 00:49:17 -08:00
parent f467a85a86
commit 47ce0ed47b
No known key found for this signature in database
GPG key ID: 18D2767419676C87

View file

@ -342,13 +342,14 @@ export const usePlayerStore = create<PlayerSlice>()(
else previousSongIndex = shuffledIndex - 1; else previousSongIndex = shuffledIndex - 1;
} }
const next = nextSongIndex const next =
? (queue.find( nextSongIndex !== undefined
(song) => ? (queue.find(
song.uniqueId === (song) =>
shuffledQueue[nextSongIndex as number], song.uniqueId ===
) as QueueSong) shuffledQueue[nextSongIndex as number],
: undefined; ) as QueueSong)
: undefined;
const previous = queue.find( const previous = queue.find(
(song) => song.uniqueId === shuffledQueue[shuffledIndex - 1], (song) => song.uniqueId === shuffledQueue[shuffledIndex - 1],