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,