mirror of
https://github.com/logancyang/obsidian-copilot.git
synced 2026-07-22 07:50:24 +00:00
feat: Implement autosave for current chat before loading chat history (#1530)
This commit is contained in:
parent
28c65710e9
commit
11eb05e9fa
1 changed files with 3 additions and 0 deletions
|
|
@ -329,6 +329,9 @@ export default class CopilotPlugin extends Plugin {
|
|||
}
|
||||
|
||||
async loadChatHistory(file: TFile) {
|
||||
// First autosave the current chat if the setting is enabled
|
||||
await this.autosaveCurrentChat();
|
||||
|
||||
const content = await this.app.vault.read(file);
|
||||
const messages = parseChatContent(content);
|
||||
this.sharedState.clearChatHistory();
|
||||
|
|
|
|||
Loading…
Reference in a new issue