fix(core): update
This commit is contained in:
parent
4456f00816
commit
286bb0887a
@ -15,7 +15,7 @@ export class ThemeManager {
|
|||||||
|
|
||||||
// lets care
|
// lets care
|
||||||
this.goBrightBoolean = this.preferredColorSchemeMediaMatch.matches;
|
this.goBrightBoolean = this.preferredColorSchemeMediaMatch.matches;
|
||||||
this.preferredColorSchemeMediaMatch.addEventListener('change', eventArg => {
|
this.preferredColorSchemeMediaMatch.addEventListener('change', (eventArg) => {
|
||||||
this.goBrightBoolean = eventArg.matches;
|
this.goBrightBoolean = eventArg.matches;
|
||||||
this.updateAllConnectedElements();
|
this.updateAllConnectedElements();
|
||||||
});
|
});
|
||||||
@ -23,7 +23,9 @@ export class ThemeManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async updateAllConnectedElements() {
|
private async updateAllConnectedElements() {
|
||||||
document.body.style.background = this.goBrightBoolean ? '#fff' : '#000';
|
if (document.body && document.body.style) {
|
||||||
|
document.body.style.background = this.goBrightBoolean ? '#fff' : '#000';
|
||||||
|
}
|
||||||
this.themeObservable.next(this.goBrightBoolean);
|
this.themeObservable.next(this.goBrightBoolean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user