mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-22 23:31:12 +02:00
feat: Invalidate logs summary and enable refetch on mount for fresh processing tasks display
This commit is contained in:
parent
35904ba0c8
commit
3ec2d46051
2 changed files with 6 additions and 0 deletions
|
|
@ -49,6 +49,10 @@ export const uploadDocumentMutationAtom = atomWithMutation((get) => {
|
||||||
|
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
toast.success("Files uploaded for processing");
|
toast.success("Files uploaded for processing");
|
||||||
|
// Invalidate logs summary to show new processing tasks immediately on documents page
|
||||||
|
queryClient.invalidateQueries({
|
||||||
|
queryKey: cacheKeys.logs.summary(searchSpaceId ?? undefined),
|
||||||
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,8 @@ export function useLogsSummary(
|
||||||
}),
|
}),
|
||||||
enabled: !!searchSpaceId,
|
enabled: !!searchSpaceId,
|
||||||
staleTime: 3 * 60 * 1000,
|
staleTime: 3 * 60 * 1000,
|
||||||
|
// Always refetch on mount to show fresh processing tasks when navigating to the page
|
||||||
|
refetchOnMount: "always",
|
||||||
// Smart polling: only poll when there are active tasks and polling is enabled
|
// Smart polling: only poll when there are active tasks and polling is enabled
|
||||||
// This prevents unnecessary API calls when nothing is being processed
|
// This prevents unnecessary API calls when nothing is being processed
|
||||||
refetchInterval: enablePolling
|
refetchInterval: enablePolling
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue