ensure song follow is run on play queue render

This commit is contained in:
jeffvli
2026-01-14 21:34:46 -08:00
parent b79ebdfbef
commit 8de80c00a8
2 changed files with 21 additions and 2 deletions
@@ -136,6 +136,24 @@ export const PlayQueue = forwardRef<ItemListHandle, QueueProps>(
setQueue();
if (followCurrentSong) {
const state = usePlayerStore.getState();
let index = state.player.index;
if (isShuffleEnabled(state)) {
index = mapShuffledToQueueIndex(index, state.queue.shuffled);
}
if (index !== -1) {
setTimeout(() => {
tableRef.current?.scrollToIndex(index, {
align: 'center',
behavior: 'auto',
});
}, 0);
}
}
return () => {
unsub();
unsubCurrentTrack();