Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: update themeId settings after theme change
In Theia, the theme ID is not always in sync with the persisted `workbench.colorTheme` preference value. For example, one can preview a theme with the `CtrlCmd+K` + `CtrlCmd+T` key chords. On quick pick selection change events, the theme changes, but the change is persisted only on accept (user presses `Enter`). IDE2 has its own way of showing and managing different settings in the UI. When the theme is changed from outside of the IDE2's UI, the model could get out of sync. This PR ensures that on `workbench.colorTheme` preference change, IDE2's settings model is synchronized with persisted Theia preferences. Closes #1987 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
  • Loading branch information
Akos Kitta committed Apr 13, 2023
commit a43145646212a5d024fbc76eed4a928d650cb480
11 changes: 11 additions & 0 deletions arduino-ide-extension/src/browser/dialogs/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ export class SettingsService {
this._settings = deepClone(settings);
this.ready.resolve();
});
this.preferenceService.onPreferenceChanged(async (event) => {
await this.ready.promise;
const { preferenceName, newValue } = event;
if (
preferenceName === 'workbench.colorTheme' &&
typeof newValue === 'string' &&
this._settings.themeId !== newValue
) {
this.reset();
}
});
}

protected async loadSettings(): Promise<Settings> {
Expand Down