Skip to content

🎧 Your Personal Streaming Service

fix(ui): prevent "Play Next" restarting play at top of queue (#5049)

Alannaa20d56c137d3
diff --git a/ui/src/reducers/playerReducer.js b/ui/src/reducers/playerReducer.js
index 92fe85df4..0392736e5 100644
--- a/ui/src/reducers/playerReducer.js
+++ b/ui/src/reducers/playerReducer.js
@@ -127,10 +127,12 @@ const reducePlayNext = (state, { data }) => {
const newQueue = []
const current = state.current || {}
let foundPos = false
+ let currentIndex = 0
state.queue.forEach((item) => {
newQueue.push(item)
if (item.uuid === current.uuid) {
foundPos = true
+ currentIndex = newQueue.length - 1
Object.keys(data).forEach((id) => {
newQueue.push(mapToAudioLists(data[id]))
})
@@ -145,6 +147,7 @@ const reducePlayNext = (state, { data }) => {
return {
...state,
queue: newQueue,
+ playIndex: foundPos ? currentIndex : undefined,
clear: true,
}
}