fix build error

This commit is contained in:
sophie committed 2026-04-17 18:55:58 +08:00
1 parent e56c7db4d7
commit 7b0ed4e88b
2 files changed
+13 -8

No files matched your search

+10 -4
View File
@@ -256,8 +256,11 @@ export function useChat() {
total: botMsg.content.length,
});
}
if (botMsgIndex !== null && messages.value[botMsgIndex]) {
applyEventMetadata(messages.value[botMsgIndex], data);
if (botMsgIndex !== null) {
const currentBotMsg = messages.value[botMsgIndex];
if (currentBotMsg) {
applyEventMetadata(currentBotMsg, data);
}
}
} else if (data.event === 'message_end') {
if (data.conversation_id) {
@@ -273,8 +276,11 @@ export function useChat() {
total: botMsg.content.length,
});
}
if (botMsgIndex !== null && messages.value[botMsgIndex]) {
applyEventMetadata(messages.value[botMsgIndex], data);
if (botMsgIndex !== null) {
const currentBotMsg = messages.value[botMsgIndex];
if (currentBotMsg) {
applyEventMetadata(currentBotMsg, data);
}
}
} else if (data.event === 'error') {
const botMsg = ensureBotMessage();