mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-18 08:26:29 +02:00
Highlight the playlist in the left panel on play (#2025)
* Fixed bad smart playlist field s * first try to add playlist highlight * Simplified calls * Now works for grids too. * Derive the playlist highlight from the currently-playing track's origin instead of a stale global field. * addressed comments
This commit is contained in:
+10
-4
@@ -64,6 +64,7 @@ export const useItemDragDropState = <TElement extends HTMLElement = HTMLDivEleme
|
||||
return draggedItems;
|
||||
},
|
||||
itemType,
|
||||
metadata: { playlistId },
|
||||
onDragStart: () => {
|
||||
if (!item || !isDataRow) {
|
||||
return;
|
||||
@@ -248,10 +249,15 @@ export const useItemDragDropState = <TElement extends HTMLElement = HTMLDivEleme
|
||||
case DragTarget.SONG: {
|
||||
const sourceItems = (args.source.item || []) as Song[];
|
||||
if (sourceItems.length > 0) {
|
||||
playerContext.addToQueueByData(sourceItems, {
|
||||
edge: args.edge,
|
||||
uniqueId: droppedOnUniqueId,
|
||||
});
|
||||
const sourcePlaylistId = args.source.metadata?.playlistId as
|
||||
| string
|
||||
| undefined;
|
||||
playerContext.addToQueueByData(
|
||||
sourceItems,
|
||||
{ edge: args.edge, uniqueId: droppedOnUniqueId },
|
||||
undefined,
|
||||
sourcePlaylistId ?? null,
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user