From 11eb05e9fafd1bc9cc4e04f7d0007c6ebe93ef7d Mon Sep 17 00:00:00 2001 From: Logan Yang Date: Sat, 7 Jun 2025 14:04:13 -0700 Subject: [PATCH] feat: Implement autosave for current chat before loading chat history (#1530) --- src/main.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.ts b/src/main.ts index 455047b5..f7f94fc8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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();