fix: add user's message to frontend chat store when sending
Previously, only the assistant's response was added to the frontend store. Now both user and assistant messages are stored, so the conversation displays correctly in the chat interface.
This commit is contained in:
@@ -44,6 +44,9 @@
|
|||||||
|
|
||||||
isSending = true;
|
isSending = true;
|
||||||
|
|
||||||
|
// Add user's message immediately
|
||||||
|
addMessage({ role: 'user', content: message });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await api.bots.chat(botId, message);
|
const response = await api.bots.chat(botId, message);
|
||||||
addMessage({ role: 'assistant', content: response.response });
|
addMessage({ role: 'assistant', content: response.response });
|
||||||
|
|||||||
Reference in New Issue
Block a user