default theme in first setup fixed

This commit is contained in:
Zurdi
2023-12-12 13:33:41 +01:00
parent b03899a2d0
commit 7cb73dec57

View File

@@ -9,7 +9,7 @@ const mediaMatch = window.matchMedia("(prefers-color-scheme: dark)");
function getTheme() {
const storedTheme = parseInt(localStorage.getItem("settings.theme"));
if (storedTheme !== null && storedTheme !== autoThemeKey) {
if (!isNaN(storedTheme) && storedTheme !== autoThemeKey) {
return themes[storedTheme];
}