Web:Common:Store: add array for available themes

This commit is contained in:
Timofey Boyko 2021-12-28 21:35:47 +08:00
parent e49d973802
commit f129a98d93

View File

@ -10,6 +10,11 @@ import { Dark, Base } from '@appserver/components/themes';
const { proxyURL } = AppServerConfig;
const themes = {
Dark: Dark,
Base: Base,
};
class SettingsStore {
isLoading = false;
isLoaded = false;
@ -364,7 +369,7 @@ class SettingsStore {
};
setTheme = (theme) => {
this.theme = theme === 'Base' ? Base : Dark;
this.theme = themes[theme];
localStorage.setItem('theme', theme);
};
}