We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d323b66 commit 23246b6Copy full SHA for 23246b6
arduino-ide-extension/src/browser/dialogs/settings/settings-component.tsx
@@ -589,9 +589,10 @@ export class SettingsComponent extends React.Component<
589
): void => {
590
const { selectedIndex } = event.target.options;
591
const theme = ThemeService.get().getThemes()[selectedIndex];
592
- const prevTheme = ThemeService.get().getCurrentTheme();
593
- if (theme && prevTheme) {
594
- this.setState({ themeId: theme.id, prevThemeId: prevTheme.id });
+ const prevThemeId =
+ this.state.prevThemeId || ThemeService.get().getCurrentTheme().id;
+ if (theme && prevThemeId) {
595
+ this.setState({ themeId: theme.id, prevThemeId: prevThemeId });
596
}
597
ThemeService.get().setCurrentTheme(theme.id);
598
};
0 commit comments