feat: Implement autosave for current chat before loading chat history (#1530)

This commit is contained in:
Logan Yang 2025-06-07 14:04:13 -07:00 committed by GitHub
parent 28c65710e9
commit 11eb05e9fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();