Skip to content

Commit

Permalink
fix(core): replace references to obsolete addListener/removeListener (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
peitschie authored Sep 12, 2023
1 parent c02e90d commit 4430722
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/components/app/app-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ class Framework7 extends Framework7Class {
const app = this;
const html = document.querySelector('html');
if (app.mq.dark && app.mq.light) {
app.mq.dark.addListener(app.colorSchemeListener);
app.mq.light.addListener(app.colorSchemeListener);
app.mq.dark.addEventListener("change", app.colorSchemeListener);
app.mq.light.addEventListener("change", app.colorSchemeListener);
}
if (app.mq.dark && app.mq.dark.matches) {
html.classList.add('dark');
Expand All @@ -216,8 +216,8 @@ class Framework7 extends Framework7Class {
const window = getWindow();
if (!window.matchMedia) return;
const app = this;
if (app.mq.dark) app.mq.dark.removeListener(app.colorSchemeListener);
if (app.mq.light) app.mq.light.removeListener(app.colorSchemeListener);
if (app.mq.dark) app.mq.dark.removeEventListener("change", app.colorSchemeListener);
if (app.mq.light) app.mq.light.removeEventListener("change", app.colorSchemeListener);
}

setDarkMode(mode) {
Expand Down

0 comments on commit 4430722

Please sign in to comment.