kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Fix #1092: Ensure player doesn't disappear when last queue track is removed manually
rodzic
1638a319cb
commit
b6a183f600
|
@ -0,0 +1 @@
|
|||
Ensure player doesn't disappear when last queue track is removed manually (#1092)
|
|
@ -104,8 +104,13 @@ export default {
|
|||
commit('splice', {start: index, size: 1})
|
||||
if (index < state.currentIndex) {
|
||||
commit('currentIndex', state.currentIndex - 1)
|
||||
}
|
||||
if (current) {
|
||||
} else if (index > 0 && index === state.tracks.length) {
|
||||
// kind of a edge case: if you delete the last track of the queue
|
||||
// we set current index to the previous one to avoid the queue tab from
|
||||
// being stuck because the player disappeared
|
||||
// cf #1092
|
||||
commit('currentIndex', state.tracks.length - 1)
|
||||
} else if (current) {
|
||||
// we play next track, which now have the same index
|
||||
commit('currentIndex', index)
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ describe('store/queue', () => {
|
|||
testAction({
|
||||
action: store.actions.cleanTrack,
|
||||
payload: 3,
|
||||
params: {state: {currentIndex: 2, tracks: []}},
|
||||
params: {state: {currentIndex: 2, tracks: [1, 2, 3, 4, 5]}},
|
||||
expectedMutations: [
|
||||
{ type: 'splice', payload: {start: 3, size: 1} }
|
||||
]
|
||||
|
|
Ładowanie…
Reference in New Issue