소스 검색

Fix: Knowledge base page crashes when network connection is lost. #4894 (#4895)

### 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)
tags/v0.17.0
balibabu 8 달 전
부모
커밋
978b580dcf
No account linked to committer's email address
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6
    1
      web/src/pages/knowledge/index.tsx

+ 6
- 1
web/src/pages/knowledge/index.tsx 파일 보기

@@ -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…
취소
저장