mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Reset the queuePos to -1 on queue change
This avoids the index ever being out of range which is what was causing the crash. The queuePos gets updated straight after the queue anyway.
This commit is contained in:
parent
d4fe7c396d
commit
30ca11fce4
@ -18,6 +18,8 @@ class QueueDataSource: NSObject, NSOutlineViewDataSource {
|
||||
let pauseIcon = NSImage(named: "pauseButton")
|
||||
|
||||
func updateQueue(_ queue: [MPDClient.Song]) {
|
||||
queuePos = -1
|
||||
|
||||
self.queue = queue.enumerated().map { index, song in
|
||||
SongItem(song: song, queuePos: index, isPlaying: index == queuePos)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user