mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-12-29 13:15:40 +01:00
Make theme-selection fall back to default ones if configured is not found
This commit is contained in:
parent
73b730e649
commit
5f48ec9e42
1 changed files with 3 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue