From 93cdc66e64b6ce2fbe10b952d8c1341af0eec187 Mon Sep 17 00:00:00 2001 From: Claire Date: Sat, 27 Apr 2024 22:01:49 +0200 Subject: [PATCH] Make `common` inheritence unconditional and simplify theming code --- app/controllers/concerns/theming_concern.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/controllers/concerns/theming_concern.rb b/app/controllers/concerns/theming_concern.rb index 4992788a04..9ef436ba8a 100644 --- a/app/controllers/concerns/theming_concern.rb +++ b/app/controllers/concerns/theming_concern.rb @@ -24,7 +24,6 @@ module ThemingConcern def nil_pack(data) { - use_common: true, flavour: data['name'], pack: nil, preload: nil, @@ -35,7 +34,6 @@ module ThemingConcern def pack(data, pack_name, skin) pack_data = { - use_common: true, flavour: data['name'], pack: pack_name, preload: nil, @@ -45,7 +43,6 @@ module ThemingConcern return pack_data unless data['pack'][pack_name].is_a?(Hash) - pack_data[:use_common] = false if data['pack'][pack_name]['use_common'] == false pack_data[:pack] = nil unless data['pack'][pack_name]['filename'] preloads = data['pack'][pack_name]['preload'] @@ -62,15 +59,12 @@ module ThemingConcern end def resolve_pack(data, pack_name, skin) - return pack(data, pack_name, skin) if valid_pack_data?(data, pack_name) - return if data['name'].blank? - - nil + pack(data, pack_name, skin) if valid_pack_data?(data, pack_name) end def resolve_pack_with_common(data, pack_name, skin = 'default') result = resolve_pack(data, pack_name, skin) || nil_pack(data) - result[:common] = resolve_pack(data, 'common', skin) if result.delete(:use_common) + result[:common] = resolve_pack(data, 'common', skin) result end end