1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-15 11:35:57 +00:00

Wrap AppBase.setupNightModeDetection() in try/catch because Safari doesn't support matchMedia change events.

This commit is contained in:
JustAMacUser
2019-12-13 13:39:52 -05:00
parent 0237dee980
commit b4dd03ba2a

View File

@@ -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)');
try {
mql.addEventListener("change", () => { mql.addEventListener("change", () => {
this.nightModeChanged(mql.matches); this.nightModeChanged(mql.matches);
}); });
} catch (e) {}
this.nightModeChanged(mql.matches); this.nightModeChanged(mql.matches);
} }