fix cannot load page when some old browsers don't support addEventListener for MediaQueryList (#588)

This commit is contained in:
MaysWind 2021-02-16 11:26:37 +08:00
parent 836b39ed3d
commit 2a3748d2d4

View file

@ -14,7 +14,10 @@
var browserSupportStorage = browserFeatures.localStroage || browserFeatures.cookies;
var browserSupportAppCache = !!$window.applicationCache;
var browserSupportMatchMedia = !!$window.matchMedia;
var browserSupportDarkMode = browserSupportMatchMedia && $window.matchMedia('(prefers-color-scheme: dark)') && $window.matchMedia('(prefers-color-scheme: dark)').media !== 'not all';
var browserSupportDarkMode = browserSupportMatchMedia
&& $window.matchMedia('(prefers-color-scheme: dark)')
&& $window.matchMedia('(prefers-color-scheme: dark)').media !== 'not all'
&& angular.isFunction($window.matchMedia('(prefers-color-scheme: dark)').addEventListener);
var onAppCacheUpdatedCallbacks = [];
var onFirstVisitCallbacks = [];