diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-02-05 10:27:24 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-02-05 10:29:27 +0100 |
commit | 5f48ec9e4264065072d3ad67a1224df76cb892da (patch) | |
tree | 30216b5cdb9ee3b98d92d38f8e1627eee86e2a18 /app | |
parent | 73b730e649555c9b0d2419130c5496e715fd3387 (diff) |
Make theme-selection fall back to default ones if configured is not found
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/application_controller.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 08cca0734..42f3081f1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -137,13 +137,12 @@ class ApplicationController < ActionController::Base end def current_flavour - return Setting.flavour unless Themes.instance.flavours.include? current_user&.setting_flavour - current_user.setting_flavour + [current_user&.setting_flavour, Setting.flavour, 'glitch', 'vanilla'].find { |flavour| Themes.instance.flavours.include?(flavour) } end def current_skin - return Setting.skin unless Themes.instance.skins_for(current_flavour).include? current_user&.setting_skin - current_user.setting_skin + skins = Themes.instance.skins_for(current_flavour) + [current_user&.setting_skin, Setting.skin, 'default'].find { |skin| skins.include?(skin) } end def respond_with_error(code) |