fix: add condition to listen for color scheme changes only in main browser window

This commit is contained in:
mr. M
2024-11-21 19:27:54 +01:00
parent 10b9f03410
commit c39253454a

View File

@@ -36,7 +36,9 @@ var ZenThemeModifier = {
},
listenForEvents() {
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', this._onPrefersColorSchemeChange.bind(this));
if (this._inMainBrowserWindow) {
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', this._onPrefersColorSchemeChange.bind(this));
}
var handleEvent = this.handleEvent.bind(this);
// Listen for changes in the accent color and border radius