diff --git a/webapp/packages/chat-sdk/src/ShowCase/index.tsx b/webapp/packages/chat-sdk/src/ShowCase/index.tsx index 5c5609650..9f2c69690 100644 --- a/webapp/packages/chat-sdk/src/ShowCase/index.tsx +++ b/webapp/packages/chat-sdk/src/ShowCase/index.tsx @@ -16,22 +16,16 @@ const ShowCase: React.FC = ({ agentId, onSendMsg }) => { const [showCaseMap, setShowCaseMap] = useState({}); const [loading, setLoading] = useState(false); - const updateData = async (pageNo: number) => { - if (pageNo === 1) { - setLoading(true); - } - const res = await queryShowCase(agentId, pageNo, 30); - if (pageNo === 1) { - setLoading(false); - } - setShowCaseMap( - pageNo === 1 ? res.data.showCaseMap : { ...showCaseMap, ...res.data.showCaseMap } - ); + const updateData = async () => { + setLoading(true); + const res = await queryShowCase(agentId, 1, 30); + setLoading(false); + setShowCaseMap(res.data.showCaseMap); }; useEffect(() => { if (agentId) { - updateData(1); + updateData(); } }, [agentId]);