mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-24 18:31:16 +01:00
Better tauri listeners and stuff
This commit is contained in:
@@ -3,7 +3,7 @@ import { invoke } from '@tauri-apps/api';
|
||||
import type { HttpRequest } from '../lib/models';
|
||||
import { useActiveWorkspaceId } from './useActiveWorkspaceId';
|
||||
|
||||
export function requestsQueryKey(workspaceId: string) {
|
||||
export function requestsQueryKey({ workspaceId }: { workspaceId: string }) {
|
||||
return ['http_requests', { workspaceId }];
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export function useRequests() {
|
||||
return (
|
||||
useQuery({
|
||||
enabled: workspaceId != null,
|
||||
queryKey: requestsQueryKey(workspaceId ?? 'n/a'),
|
||||
queryKey: requestsQueryKey({ workspaceId: workspaceId ?? 'n/a' }),
|
||||
queryFn: async () => {
|
||||
if (workspaceId == null) return [];
|
||||
return (await invoke('requests', { workspaceId })) as HttpRequest[];
|
||||
|
||||
Reference in New Issue
Block a user