diff --git a/src/app/playground/chat/page.tsx b/src/app/playground/chat/page.tsx index 46dfd2ab..48bc9dd7 100644 --- a/src/app/playground/chat/page.tsx +++ b/src/app/playground/chat/page.tsx @@ -171,7 +171,9 @@ const ChatPage: React.FC = () => { setMessages((messages) => { const updatedMessages = [...messages]; - updatedMessages[updatedMessages.length - 1].text = botMessage; + if (updatedMessages.length > 1) { + updatedMessages[updatedMessages.length - 1].text = botMessage; + } return updatedMessages; }); }