Fixed dark theme now applying on the first time

This commit is contained in:
2023-12-05 10:45:41 +01:00
parent ebb6730a1b
commit c3f583a31c
2 changed files with 36 additions and 19 deletions

View File

@@ -18,7 +18,10 @@ function changeLogoForTheme(){
}
function isDarkModeSet(){
return localStorage.theme == "dark";
if (localStorage.theme)
return localStorage.theme == "dark";
else
return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
}
function changeTheme(theme:string){