summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJustAMacUser <[email protected]>2019-12-13 13:39:52 -0500
committerJustAMacUser <[email protected]>2019-12-13 13:39:52 -0500
commitb4dd03ba2a2a38109afb242eb7b14b52f6e214ac (patch)
treeae9f732e367f32fb8308c5a139418a7fd3846ad5 /js
parent0237dee980157554ab2c9a79b6e9d10cec9e2f3a (diff)
Wrap AppBase.setupNightModeDetection() in try/catch because Safari doesn't support matchMedia change events.
Diffstat (limited to 'js')
-rw-r--r--js/AppBase.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/js/AppBase.js b/js/AppBase.js
index db524296c..a348c95f8 100644
--- a/js/AppBase.js
+++ b/js/AppBase.js
@@ -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);
}