feat: 修复打字机效果闪烁的问题

This commit is contained in:
2025-08-10 17:14:01 +08:00
parent 33168361ed
commit fee7fda208

View File

@@ -344,6 +344,7 @@ const initWebSocket = () => {
// 错误回调 // 错误回调
onError: (error) => { onError: (error) => {
isSessionActive.value = false;
console.error("WebSocket错误:", error); console.error("WebSocket错误:", error);
}, },
@@ -367,6 +368,10 @@ const initWebSocket = () => {
// 处理WebSocket消息 // 处理WebSocket消息
const handleWebSocketMessage = (data) => { const handleWebSocketMessage = (data) => {
if(loadingTimer) {
clearInterval(loadingTimer);
loadingTimer = null;
}
const aiMsgIndex = chatMsgList.value.length - 1; const aiMsgIndex = chatMsgList.value.length - 1;
if (!chatMsgList.value[aiMsgIndex] || aiMsgIndex < 0) { if (!chatMsgList.value[aiMsgIndex] || aiMsgIndex < 0) {
return; return;