mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 14:25:55 +00:00
Wrap AppBase.setupNightModeDetection() in try/catch because Safari doesn't support matchMedia change events.
This commit is contained in:
@@ -34,9 +34,11 @@ define(["dojo/_base/declare"], function (declare) {
|
||||
if (window.matchMedia) {
|
||||
const mql = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
|
||||
mql.addEventListener("change", () => {
|
||||
this.nightModeChanged(mql.matches);
|
||||
});
|
||||
try {
|
||||
mql.addEventListener("change", () => {
|
||||
this.nightModeChanged(mql.matches);
|
||||
});
|
||||
} catch (e) {}
|
||||
|
||||
this.nightModeChanged(mql.matches);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user