Fix GRPC with files not refreshing, and tight render loop

This commit is contained in:
Gregory Schier
2024-06-20 08:40:10 -07:00
parent 92b1582232
commit 88aeb0e530
62 changed files with 221 additions and 163 deletions

View File

@@ -1,14 +1,14 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { invoke } from '@tauri-apps/api/core';
import { trackEvent } from '../lib/analytics';
import type { GrpcConnection } from '../lib/models';
import { invokeCmd } from '../lib/tauri';
import { grpcConnectionsQueryKey } from './useGrpcConnections';
export function useDeleteGrpcConnection(id: string | null) {
const queryClient = useQueryClient();
return useMutation<GrpcConnection>({
mutationFn: async () => {
return await invoke('cmd_delete_grpc_connection', { id: id });
return await invokeCmd('cmd_delete_grpc_connection', { id: id });
},
onSettled: () => trackEvent('grpc_connection', 'delete'),
onSuccess: ({ requestId, id: connectionId }) => {