mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 17:48:30 +02:00
Try fix for template tags not re-fetching on Windows
This commit is contained in:
@@ -8,11 +8,12 @@ export function useTemplateFunctions() {
|
|||||||
|
|
||||||
const result = useQuery({
|
const result = useQuery({
|
||||||
queryKey: ['template_functions', pluginsKey],
|
queryKey: ['template_functions', pluginsKey],
|
||||||
|
// NOTE: visibilitychange (refetchOnWindowFocus) does not work on Windows, so we'll rely on mount to
|
||||||
|
// refetch template functions for us when. This should handle the case where the plugin system isn't
|
||||||
|
// quite ready the first time this is invoked.
|
||||||
|
refetchOnMount: true,
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const responses = (await invokeCmd(
|
return invokeCmd<GetTemplateFunctionsResponse[]>('cmd_template_functions');
|
||||||
'cmd_template_functions',
|
|
||||||
)) as GetTemplateFunctionsResponse[];
|
|
||||||
return responses;
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user