[techdocs/cli] Use light theme if it's not dark, to avoid breaking the theme selector on other values in local storage
Fixes #12995 Signed-off-by: Axel Hecht <axel@pike.org>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'techdocs-cli-embedded-app': patch
|
||||
---
|
||||
|
||||
Theme selector in `npx @techdocs/cli serve` would break if localstorage had a non-light-or-dark value for theme.
|
||||
@@ -55,7 +55,7 @@ export const TechDocsThemeToggle = () => {
|
||||
const appThemeApi = useApi(appThemeApiRef);
|
||||
const classes = useStyles();
|
||||
const [theme, setTheme] = useState<Themes>(
|
||||
(appThemeApi.getActiveThemeId() as Themes) || Themes.LIGHT,
|
||||
appThemeApi.getActiveThemeId() === Themes.DARK ? Themes.DARK : Themes.LIGHT,
|
||||
);
|
||||
|
||||
const themes = {
|
||||
|
||||
Reference in New Issue
Block a user