...lodash random uses inclusive on both ends

This commit is contained in:
Kendall Garner 2025-07-06 21:26:30 -07:00
parent a86d44a29e
commit 5eacb4e3cb
No known key found for this signature in database
GPG key ID: 9355F387FE765C94

View file

@ -151,7 +151,7 @@ export const usePlayerStore = createWithEqualityFn<PlayerSlice>()(
const index =
initialIndex !== undefined
? initialIndex
: random(0, songsToAddToQueue.length, false);
: random(0, songsToAddToQueue.length - 1, false);
const initialSong = songsToAddToQueue[index];
const queueCopy = [...songsToAddToQueue];