修复目的地识别、报价短追问及删除后历史同步
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user