Add "Play Later" action to AlbumContextMenu
This commit is contained in:
@@ -22,10 +22,10 @@ const AddToQueueButton = ({ selectedIds }) => {
|
||||
.getMany('song', { ids: selectedIds })
|
||||
.then((response) => {
|
||||
// Add tracks to a map for easy lookup by ID, needed for the next step
|
||||
const tracks = response.data.reduce((acc, cur) => {
|
||||
acc[cur.id] = cur
|
||||
return acc
|
||||
}, {})
|
||||
const tracks = response.data.reduce(
|
||||
(acc, cur) => ({ ...acc, [cur.id]: cur }),
|
||||
{}
|
||||
)
|
||||
// Add the tracks to the queue in the selection order
|
||||
dispatch(addTracks(selectedIds.map((id) => tracks[id])))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user