forked from wallabag/wallabag
Fix auto prefered color scheme
This commit is contained in:
@ -63,9 +63,10 @@ function darkTheme() {
|
|||||||
};
|
};
|
||||||
const preferedColorScheme = {
|
const preferedColorScheme = {
|
||||||
choose() {
|
choose() {
|
||||||
if (this.isAvailable() && themeCookie.exists() === 0) {
|
const themeCookieExists = themeCookie.exists();
|
||||||
|
if (this.isAvailable() && !themeCookieExists) {
|
||||||
const isPreferedColorSchemeDark = window.matchMedia('(prefers-color-scheme: dark)').matches === true;
|
const isPreferedColorSchemeDark = window.matchMedia('(prefers-color-scheme: dark)').matches === true;
|
||||||
if (themeCookie.exists() === 0) {
|
if (!themeCookieExists) {
|
||||||
themeDom[isPreferedColorSchemeDark ? 'addClass' : 'removeClass'](rootEl);
|
themeDom[isPreferedColorSchemeDark ? 'addClass' : 'removeClass'](rootEl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user