1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Theme switch fixes

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-03-05 12:41:26 +03:00
parent 8da80449fa
commit 4114ad2c72

View File

@ -36,7 +36,7 @@ export class ThemeStore extends Singleton {
"lens-light": lensLightThemeJson as Theme, "lens-light": lensLightThemeJson as Theme,
}); });
private osNativeTheme: "dark" | "light" | undefined; @observable osNativeTheme: "dark" | "light" | undefined;
@computed get activeThemeId(): ThemeId { @computed get activeThemeId(): ThemeId {
return UserStore.getInstance().colorTheme; return UserStore.getInstance().colorTheme;
@ -131,11 +131,12 @@ export class ThemeStore extends Singleton {
} }
getThemeById(themeId: ThemeId): Theme { getThemeById(themeId: ThemeId): Theme {
return this.systemTheme ?? this.themes.get(themeId); return this.themes.get(themeId);
} }
protected applyTheme(themeId: ThemeId) { protected applyTheme(themeId: ThemeId) {
const theme = this.getThemeById(themeId); const theme = this.systemTheme ?? this.getThemeById(themeId);
const colors = Object.entries({ const colors = Object.entries({
...theme.colors, ...theme.colors,
...Object.fromEntries(this.terminalColors), ...Object.fromEntries(this.terminalColors),