mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
fix shuffle mode playback index (#1297)
This commit is contained in:
@@ -2087,7 +2087,12 @@ export const subscribeCurrentTrack = (
|
|||||||
return usePlayerStoreBase.subscribe(
|
return usePlayerStoreBase.subscribe(
|
||||||
(state) => {
|
(state) => {
|
||||||
const queue = state.getQueue();
|
const queue = state.getQueue();
|
||||||
const index = state.player.index;
|
let index = state.player.index;
|
||||||
|
|
||||||
|
if (isShuffleEnabled(state)) {
|
||||||
|
index = mapShuffledToQueueIndex(index, state.queue.shuffled);
|
||||||
|
}
|
||||||
|
|
||||||
return { index, song: queue.items[index] };
|
return { index, song: queue.items[index] };
|
||||||
},
|
},
|
||||||
(song, prevSong) => {
|
(song, prevSong) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user