File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
redisinsight/ui/src/contexts Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -49,17 +49,20 @@ export class ThemeProvider extends React.Component<Props> {
49
49
constructor ( props : any ) {
50
50
super ( props )
51
51
52
- // theme query param can be used to override the local/default theme
53
52
const queryTheme = getQueryTheme ( )
54
53
const storedThemeValue = localStorageService . get ( BrowserStorageItem . theme )
55
- const theme =
56
- queryTheme ||
57
- ( ! storedThemeValue || ! THEME_NAMES . includes ( storedThemeValue )
58
- ? defaultState . theme
59
- : storedThemeValue )
54
+
55
+ let theme = defaultState . theme
56
+
57
+ if ( queryTheme ) {
58
+ theme = queryTheme
59
+ } else if ( storedThemeValue && THEME_NAMES . includes ( storedThemeValue ) ) {
60
+ theme = storedThemeValue
61
+ }
62
+
60
63
const usingSystemTheme = theme === Theme . System
61
64
62
- themeService . applyTheme ( theme )
65
+ themeService . applyTheme ( theme as Theme )
63
66
64
67
this . state = {
65
68
theme : theme === Theme . System ? this . getSystemTheme ( ) : theme ,
You can’t perform that action at this time.
0 commit comments