Parcourir la source

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 il y a 8 mois
Parent
révision
978b580dcf
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6
    1
      web/src/pages/knowledge/index.tsx

+ 6
- 1
web/src/pages/knowledge/index.tsx Voir le fichier

@@ -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;

Chargement…
Annuler
Enregistrer