Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Revert "change reset function"
This reverts commit d323b66.
  • Loading branch information
francescospissu committed Aug 5, 2022
commit cdbe468e34c9b1f6022853f364f28e46be07a8d6
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class Settings extends SketchContribution {
await this.settingsService.update(settings);
await this.settingsService.save();
} else {
await this.settingsService.resetFromDialog();
await this.settingsService.reset(true);
}
},
isEnabled: () => !this.settingsOpened,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class SettingsDialog extends AbstractDialog<Promise<Settings>> {

// calling settingsService.reset() in order to reload the settings from the preferenceService
// and update the UI including changes triggered from the command palette
this.settingsService.reset();
this.settingsService.reset(false);

this.widget.activate();
}
Expand Down
10 changes: 3 additions & 7 deletions arduino-ide-extension/src/browser/dialogs/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,14 @@ export class SettingsService {
}
}

async reset(): Promise<void> {
async reset(resetFromDialog: boolean): Promise<void> {
const prevThemeId = this._settings.prevThemeId;
const settings = await this.loadSettings();
await this.update(settings, false);
this.onDidResetEmitter.fire(this._settings);
}

async resetFromDialog(): Promise<void> {
const prevThemeId = this._settings.prevThemeId;
if (prevThemeId) {
if (resetFromDialog && prevThemeId) {
ThemeService.get().setCurrentTheme(prevThemeId);
}
this.reset();
}

async validate(
Expand Down