修复目的地识别、报价短追问及删除后历史同步

This commit is contained in:
2026-10-29 19:04:05 +08:00
parent f4e87b0c02
commit 8444ded971
9 changed files with 151 additions and 15 deletions
+9
View File
@@ -586,6 +586,7 @@ clearAllBtn.onclick = function(){
openingConv = null;
setComposerStatus('');
chatDom.innerHTML = welcomeHTML();
removeCachedHistory();
loadHistory();
}).catch(function(){
if(version !== conversationVersion) return;
@@ -622,6 +623,13 @@ function loadHistory(){
}).catch(function(){ /* 保留上次成功加载的历史,避免网络错误清空侧栏。 */ });
}
function removeCachedHistory(id){
historyRequestVersion += 1;
historyList = id === undefined ? [] : historyList.filter(item => item.id !== id);
renderSideHistory();
renderRecentChat();
}
function renderSideHistory(){
leftHistoryWrap.innerHTML = "";
const kw = (document.getElementById("history-search")?.value || "").trim().toLowerCase();
@@ -695,6 +703,7 @@ function renderSideHistory(){
resetConversation(null);
chatDom.innerHTML = welcomeHTML();
}
removeCachedHistory(item.id);
return loadHistory();
}).catch(function(){
if(version === conversationVersion) setComposerStatus(t('networkFail'), true);