mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Fix queuepos out of bounds error
Sometimes the status gets updated before the queue has been retrieved. In these cases we want to skip setting the current song until it has been.
This commit is contained in:
parent
8e81636500
commit
9a69734c23
@ -36,7 +36,7 @@ func queueReducer(action: Action, state: QueueState?) -> QueueState {
|
||||
if oldSongRowPos >= 0 {
|
||||
state.queue[oldSongRowPos].isPlaying = false
|
||||
}
|
||||
if newSongRowPos >= 0 {
|
||||
if newSongRowPos >= 0 && state.queue.count > newSongRowPos {
|
||||
state.queue[newSongRowPos].isPlaying = true
|
||||
|
||||
DispatchQueue.main.async {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user