refactor: change network mode defaults

This commit is contained in:
Carlos Valente
2025-05-16 20:03:06 +02:00
committed by Carlos Valente
parent 21353b5b00
commit df55b0bf8d
3 changed files with 28 additions and 13 deletions
+2 -12
View File
@@ -75,10 +75,7 @@ export const useEntryActions = () => {
const _addEntryMutation = useMutation({
// TODO(v4): optimistic create entry
mutationFn: postAddEntry,
onSettled: () => {
queryClient.invalidateQueries({ queryKey: RUNDOWN });
},
networkMode: 'always',
onSettled: () => queryClient.invalidateQueries({ queryKey: RUNDOWN }),
});
/**
@@ -207,7 +204,6 @@ export const useEntryActions = () => {
onSettled: async () => {
await queryClient.invalidateQueries({ queryKey: RUNDOWN });
},
networkMode: 'always',
});
/**
@@ -372,7 +368,6 @@ export const useEntryActions = () => {
onError: (_error, _newEvent, context) => {
queryClient.setQueryData<Rundown>(RUNDOWN, context?.previousRundown);
},
networkMode: 'always',
});
const batchUpdateEvents = useCallback(
@@ -427,7 +422,6 @@ export const useEntryActions = () => {
onSettled: () => {
queryClient.invalidateQueries({ queryKey: RUNDOWN });
},
networkMode: 'always',
});
/**
@@ -481,7 +475,6 @@ export const useEntryActions = () => {
onSettled: () => {
queryClient.invalidateQueries({ queryKey: RUNDOWN });
},
networkMode: 'always',
});
/**
@@ -505,14 +498,13 @@ export const useEntryActions = () => {
onSettled: () => {
queryClient.invalidateQueries({ queryKey: RUNDOWN });
},
networkMode: 'always',
});
/**
* Applies a given delay
*/
const applyDelay = useCallback(
async (delayEventId: string) => {
async (delayEventId: EntryId) => {
try {
await _applyDelayMutation.mutateAsync(delayEventId);
} catch (error) {
@@ -562,7 +554,6 @@ export const useEntryActions = () => {
onSettled: () => {
queryClient.invalidateQueries({ queryKey: RUNDOWN });
},
networkMode: 'always',
});
/**
@@ -634,7 +625,6 @@ export const useEntryActions = () => {
onSettled: () => {
queryClient.invalidateQueries({ queryKey: RUNDOWN });
},
networkMode: 'always',
});
/**