Fix flickering document count and total when toggling file filter on search page (#17161)

This commit is contained in:
euvre
2026-07-22 14:57:04 +08:00
committed by GitHub
parent ff1274895f
commit f2a48df56b
2 changed files with 2 additions and 4 deletions

View File

@@ -1075,7 +1075,7 @@ export const useSelectTestingResult = (): ITestingResult => {
return mutation.state.data;
},
});
return (data.at(-1) ?? {
return (data.filter((x) => x !== undefined).at(-1) ?? {
chunks: [],
documents: [],
total: 0,
@@ -1109,7 +1109,7 @@ export const useAllTestingResult = (): ITestingResult => {
return mutation.state.data;
},
});
return (data.at(-1) ?? {
return (data.filter((x) => x !== undefined).at(-1) ?? {
chunks: [],
documents: [],
total: 0,

View File

@@ -149,7 +149,6 @@ export const useTestChunkRetrieval = (
mutateAsync,
} = useMutation({
mutationKey: ['testChunk'], // This method is invalid
gcTime: 0,
mutationFn: async (values: any) => {
const { data } = await retrievalTestFunc({
page,
@@ -200,7 +199,6 @@ export const useTestChunkAllRetrieval = (
mutateAsync,
} = useMutation({
mutationKey: ['testChunkAll'], // This method is invalid
gcTime: 0,
mutationFn: async (values: any) => {
const { data } = await retrievalTestFunc({
page,