Fix: Chat Assistant page goes blank #4566 (#4727)

### What problem does this PR solve?

Fix: Chat Assistant page goes blank #4566

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu 2025-02-05 18:19:38 +08:00 committed by GitHub
parent 3411d0a2ce
commit efbaa484d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,7 +54,8 @@ const MarkdownContent = ({
}, [content, loading, t]);
useEffect(() => {
setDocumentIds(reference?.doc_aggs?.map((x) => x.doc_id) ?? []);
const docAggs = reference?.doc_aggs;
setDocumentIds(Array.isArray(docAggs) ? docAggs.map((x) => x.doc_id) : []);
}, [reference, setDocumentIds]);
const handleDocumentButtonClick = useCallback(