mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-21 03:14:16 +02:00
Wrap queue handler in callback
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import { api } from '@/renderer/api';
|
||||
import { queryKeys } from '@/renderer/api/query-keys';
|
||||
@@ -20,7 +21,8 @@ export const usePlayQueueHandler = () => {
|
||||
const addToQueue = usePlayerStore((state) => state.addToQueue);
|
||||
const playerType = useSettingsStore((state) => state.player.type);
|
||||
|
||||
const handlePlayQueueAdd = async (options: PlayQueueAddOptions) => {
|
||||
const handlePlayQueueAdd = useCallback(
|
||||
async (options: PlayQueueAddOptions) => {
|
||||
if (options.byData) {
|
||||
// dispatchSongsToQueue(options.byData, options.play);
|
||||
}
|
||||
@@ -77,7 +79,17 @@ export const usePlayQueueHandler = () => {
|
||||
play();
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
[
|
||||
addToQueue,
|
||||
isImageTokenRequired,
|
||||
play,
|
||||
playerType,
|
||||
queryClient,
|
||||
serverId,
|
||||
serverToken,
|
||||
]
|
||||
);
|
||||
|
||||
return handlePlayQueueAdd;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user