mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
implement queue double click handler
This commit is contained in:
@@ -3,6 +3,7 @@ import { useMemo } from 'react';
|
|||||||
import { ItemListStateItemWithRequiredProperties } from '/@/renderer/components/item-list/helpers/item-list-state';
|
import { ItemListStateItemWithRequiredProperties } from '/@/renderer/components/item-list/helpers/item-list-state';
|
||||||
import { DefaultItemControlProps, ItemControls } from '/@/renderer/components/item-list/types';
|
import { DefaultItemControlProps, ItemControls } from '/@/renderer/components/item-list/types';
|
||||||
import { usePlayerContext } from '/@/renderer/features/player/context/player-context';
|
import { usePlayerContext } from '/@/renderer/features/player/context/player-context';
|
||||||
|
import { LibraryItem, QueueSong } from '/@/shared/types/domain-types';
|
||||||
import { Play } from '/@/shared/types/types';
|
import { Play } from '/@/shared/types/types';
|
||||||
|
|
||||||
export const useDefaultItemListControls = () => {
|
export const useDefaultItemListControls = () => {
|
||||||
@@ -143,8 +144,17 @@ export const useDefaultItemListControls = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onDoubleClick: ({ internalState, item, itemType }: DefaultItemControlProps) => {
|
onDoubleClick: ({ item, itemType }: DefaultItemControlProps) => {
|
||||||
console.log('onDoubleClick', item, itemType, internalState);
|
if (!item) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemType === LibraryItem.QUEUE_SONG) {
|
||||||
|
const queueSong = item as QueueSong;
|
||||||
|
if (queueSong._uniqueId) {
|
||||||
|
player.mediaPlay(queueSong._uniqueId);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onExpand: ({ internalState, item }: DefaultItemControlProps) => {
|
onExpand: ({ internalState, item }: DefaultItemControlProps) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user