Skip to content

Commit

Permalink
Check widget is dirty before saving
Browse files Browse the repository at this point in the history
Signed-off-by: thegecko <rob.moran@arm.com>
  • Loading branch information
thegecko committed Apr 22, 2021
1 parent 66b3dc3 commit a082473
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/browser/shell/application-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,11 @@ export class ApplicationShell extends Widget {
* Save all dirty widgets.
*/
async saveAll(options?: SaveOptions): Promise<void> {
await Promise.all(this.tracker.widgets.map(widget => Saveable.save(widget, options)));
await Promise.all(this.tracker.widgets.map(widget => {
if (Saveable.isDirty(widget)) {
Saveable.save(widget, options);
}
}));
}

/**
Expand Down

0 comments on commit a082473

Please sign in to comment.