Skip to content

Use same autosave heuristic when closing widget #15502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/core/src/browser/saveable-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,12 @@ export class SaveableService implements FrontendApplicationContribution {
if (!Saveable.isDirty(widget)) {
return false;
}
if (this.autoSave !== 'off') {
const saveable = Saveable.get(widget);
if (!saveable) {
console.warn('Saveable.get returned undefined on a known saveable widget. This is unexpected.');
}
// Enter branch if saveable absent since we cannot check autosaveability more definitely.
if (this.autoSave !== 'off' && (!saveable || this.shouldAutoSave(widget, saveable))) {
return true;
}
const notLastWithDocument = !Saveable.closingWidgetWouldLoseSaveable(widget, Array.from(this.saveThrottles.keys()));
Expand Down
Loading