Handle invalid theme in ui state (#1504)

This commit is contained in:
Steve Richter 2022-01-05 18:47:14 -05:00 committed by Joe Stump
parent dd117130ff
commit bcec5ee3de
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9

View File

@ -12,7 +12,7 @@ const useCurrentTheme = () => {
return prefersLightMode ? themes.LightTheme : themes.DarkTheme
}
const themeName =
state.theme ||
Object.keys(themes).find((t) => t === state.theme) ||
Object.keys(themes).find(
(t) => themes[t].themeName === config.defaultTheme
) ||