(fix)(chat-sdk) fix error when showcase return null (#636)

This commit is contained in:
williamhliu
2024-01-17 13:56:01 +08:00
committed by GitHub
parent 74b89a9430
commit eb08667d90

View File

@@ -31,7 +31,7 @@ const ShowCase: React.FC<Props> = ({ height, agentId, onSendMsg }) => {
if (pageNoValue === 1) {
setLoading(false);
}
const showCaseMapRes: any = res.data.showCaseMap;
const showCaseMapRes: any = res.data.showCaseMap || [];
const list = Object.keys(showCaseMapRes)
.reduce((result: ShowCaseItemType[], key: string) => {
result.push({ msgList: showCaseMapRes[key], caseId: key });