Commit 9efafffd authored by Tony Wasserka's avatar Tony Wasserka
Browse files

Reset playback when reaching the queue end

Closes #1380.
parent 461c55e0
Fixed track playback indicator to reset on queue end (#1380)
......@@ -126,7 +126,7 @@ export default {
logger.default.error('Could not record track in history')
})
},
trackEnded ({dispatch, rootState}, track) {
trackEnded ({commit, dispatch, rootState}, track) {
let queueState = rootState.queue
if (queueState.currentIndex === queueState.tracks.length - 1) {
// we've reached last track of queue, trigger a reload
......@@ -134,6 +134,11 @@ export default {
dispatch('radios/populateQueue', null, {root: true})
}
dispatch('queue/next', null, {root: true})
if (queueState.ended) {
// Reset playback
commit('playing', false)
dispatch('updateProgress', 0)
}
},
trackErrored ({commit, dispatch, state}) {
commit('errored', true)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment