Wrap AppBase.setupNightModeDetection() in try/catch because Safari doesn't support matchMedia change events.
This commit is contained in:
parent
0237dee980
commit
b4dd03ba2a
|
@ -34,9 +34,11 @@ define(["dojo/_base/declare"], function (declare) {
|
||||||
if (window.matchMedia) {
|
if (window.matchMedia) {
|
||||||
const mql = window.matchMedia('(prefers-color-scheme: dark)');
|
const mql = window.matchMedia('(prefers-color-scheme: dark)');
|
||||||
|
|
||||||
mql.addEventListener("change", () => {
|
try {
|
||||||
this.nightModeChanged(mql.matches);
|
mql.addEventListener("change", () => {
|
||||||
});
|
this.nightModeChanged(mql.matches);
|
||||||
|
});
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
this.nightModeChanged(mql.matches);
|
this.nightModeChanged(mql.matches);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue