fix(editor): auto-save when the app is deactivated while focus is in a frame (#1636)

With focus in a plugin's web view, the window's blur fires when the frame takes focus, before any edit, and not again when the user switches applications, so edits made in the frame weren't auto-saved. The editor now also saves on the application-deactivated event.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-06 06:33:12 +08:00
1 джерело 83d2f67b4f
коміт a6cf4442d8
3 files changed
+31

No files matched your search

+2
Переглянути файл
@@ -353,6 +353,8 @@ export class EditorController implements SlotHost {
void this.saveCustomDocuments(true).catch((e) => this.documentError(e));
}
};
if (this.manager.backend.onApplicationDeactivated)
this.disposers.push(this.manager.backend.onApplicationDeactivated(onWindowBlur));
const onPageHide = () => this.saveSession();
if (typeof window !== "undefined") {
if (this.manager.backend.syncFromDisk)