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

This commit is contained in:
williamhliu
2024-01-17 13:59:57 +08:00
committed by GitHub
parent eb08667d90
commit b2beecb5b8

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 });