mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-11 13:59:03 +08:00
### What problem does this PR solve? Fix: Knowledge base page crashes when network connection is lost. #4894 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
d197f33646
commit
978b580dcf
@ -38,7 +38,12 @@ const KnowledgeList = () => {
|
||||
handleInputChange,
|
||||
loading,
|
||||
} = useInfiniteFetchKnowledgeList();
|
||||
const nextList = data?.pages?.flatMap((x) => x.kbs) ?? [];
|
||||
|
||||
const nextList = useMemo(() => {
|
||||
const list =
|
||||
data?.pages?.flatMap((x) => (Array.isArray(x.kbs) ? x.kbs : [])) ?? [];
|
||||
return list;
|
||||
}, [data?.pages]);
|
||||
|
||||
const total = useMemo(() => {
|
||||
return data?.pages.at(-1).total ?? 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user