Clean up model fetching and loading states

This commit is contained in:
Gregory Schier
2025-01-20 13:44:11 -08:00
parent 0453e84d38
commit 8ad7ac0bef
42 changed files with 180 additions and 247 deletions

View File

@@ -1,9 +1,8 @@
import { useFastMutation } from './useFastMutation';
import type { GrpcRequest } from '@yaakapp-internal/models';
import { useSetAtom } from 'jotai/index';
import { getGrpcRequest } from '../lib/store';
import { invokeCmd } from '../lib/tauri';
import { grpcRequestsAtom } from './useGrpcRequests';
import { useFastMutation } from './useFastMutation';
import { getGrpcRequest, grpcRequestsAtom } from './useGrpcRequests';
import { updateModelList } from './useSyncModelStores';
export function useUpdateAnyGrpcRequest() {
@@ -15,7 +14,7 @@ export function useUpdateAnyGrpcRequest() {
>({
mutationKey: ['update_any_grpc_request'],
mutationFn: async ({ id, update }) => {
const request = await getGrpcRequest(id);
const request = getGrpcRequest(id);
if (request === null) {
throw new Error("Can't update a null request");
}