mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
optimize the title for new chat, fixed bug for clear chat history
This commit is contained in:
parent
c08cef0765
commit
673cdada5a
@ -55,6 +55,7 @@ export function appendChatHistory(chatId, message) {
|
||||
|
||||
export function clearChatHistory() {
|
||||
Storage.remove(ChatHistoryKey);
|
||||
Storage.remove(ChatListKey);
|
||||
}
|
||||
|
||||
// 获取指定会话的历史记录
|
||||
|
@ -514,6 +514,8 @@ export default defineComponent({
|
||||
}
|
||||
).then(() => {
|
||||
clearChatHistory();
|
||||
this.chatData = [];
|
||||
this.chatList = [];
|
||||
ElMessage.success("当前角色会话已清空");
|
||||
}).catch(() => {
|
||||
})
|
||||
@ -552,6 +554,7 @@ export default defineComponent({
|
||||
if (chatHistory === null) {
|
||||
return;
|
||||
}
|
||||
this.curChat.title = chatHistory[0].content;
|
||||
// 追加会话
|
||||
setChat(this.curChat);
|
||||
}
|
||||
@ -591,6 +594,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
},
|
||||
// 取消修改
|
||||
cancel: function (chat) {
|
||||
chat.edit = false;
|
||||
chat.removing = false;
|
||||
|
Loading…
Reference in New Issue
Block a user