Rever to sensisble defaults
This commit is contained in:
parent
258a604cc6
commit
a639fc5467
1 changed files with 8 additions and 2 deletions
|
@ -157,8 +157,14 @@ export class ThemeLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
async getActiveTheme(): Promise<{themeName: string, themeVariant?: string}> {
|
async getActiveTheme(): Promise<{themeName: string, themeVariant?: string}> {
|
||||||
const themeName = await this._platform.settingsStorage.getString("theme-name") ?? "Default";
|
let themeName = await this._platform.settingsStorage.getString("theme-name");
|
||||||
const themeVariant = await this._platform.settingsStorage.getString("theme-variant");
|
let themeVariant = await this._platform.settingsStorage.getString("theme-variant");
|
||||||
|
if (!themeName || !this._themeMapping[themeName]) {
|
||||||
|
themeName = "Default" in this._themeMapping ? "Default" : Object.keys(this._themeMapping)[0];
|
||||||
|
if (!this._themeMapping[themeName][themeVariant]) {
|
||||||
|
themeVariant = "default" in this._themeMapping[themeName] ? "default" : undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
return { themeName, themeVariant };
|
return { themeName, themeVariant };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue