Browse Source

Fix error when no theme is set and the auto theme is not supported

Jed Fox 5 years ago
parent
commit
6832c1ccf6
1 changed files with 4 additions and 0 deletions
  1. 4 0
      assets/javascripts/app/settings.coffee

+ 4 - 0
assets/javascripts/app/settings.coffee

@@ -46,6 +46,10 @@ class app.Settings
   get: (key) ->
     return @cache[key] if @cache.hasOwnProperty(key)
     @cache[key] = @store.get(key) ? @constructor.defaults[key]
+    if key == 'theme' and @cache[key] == 'auto' and !@darkModeQuery
+      @cache[key] = 'default'
+    else
+      @cache[key]
 
   set: (key, value) ->
     @store.set(key, value)