Fixed dark theme not applying on the first time (#273)
Reviewed-on: #273 Reviewed-by: Mikolaj Widla <widlam@noreply.example.com> Co-authored-by: Adam Bem <adam.bem@zoho.eu> Co-committed-by: Adam Bem <adam.bem@zoho.eu>
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user