mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-19 07:54:23 +01:00
Fix pool management
This commit is contained in:
@@ -54,9 +54,10 @@ export function useGrpc(req: GrpcRequest | null, conn: GrpcConnection | null) {
|
||||
const debouncedUrl = useDebouncedValue<string>(req?.url ?? 'n/a', 1000);
|
||||
const reflect = useQuery<ReflectResponseService[] | null, string>({
|
||||
enabled: req != null,
|
||||
queryKey: ['grpc_reflect', debouncedUrl],
|
||||
queryKey: ['grpc_reflect', req?.id ?? 'n/a', debouncedUrl],
|
||||
refetchOnWindowFocus: false,
|
||||
queryFn: async () => {
|
||||
console.log('useGrpc.reflect', { requestId });
|
||||
return (await minPromiseMillis(
|
||||
invoke('cmd_grpc_reflect', { requestId }),
|
||||
300,
|
||||
|
||||
@@ -112,11 +112,11 @@ export function useAnyHotkey(
|
||||
}
|
||||
currentKeys.current.delete(normalizeKey(e.key, os));
|
||||
};
|
||||
window.addEventListener('keydown', down);
|
||||
window.addEventListener('keyup', up);
|
||||
document.addEventListener('keydown', down);
|
||||
document.addEventListener('keyup', up);
|
||||
return () => {
|
||||
window.removeEventListener('keydown', down);
|
||||
window.removeEventListener('keyup', up);
|
||||
document.removeEventListener('keydown', down);
|
||||
document.removeEventListener('keyup', up);
|
||||
};
|
||||
}, [options.enable, os]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user