mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
FIX: ColorScheme color missing was returning "nil"
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_dependency 'distributed_cache'
|
||||
|
||||
class ColorScheme < ActiveRecord::Base
|
||||
@@ -108,12 +110,12 @@ class ColorScheme < ActiveRecord::Base
|
||||
|
||||
def self.lookup_hex_for_name(name)
|
||||
enabled_color_scheme = Theme.where(key: SiteSetting.default_theme_key).first&.color_scheme
|
||||
(enabled_color_scheme || base).colors.find { |c| c.name == name }.try(:hex) || :nil
|
||||
(enabled_color_scheme || base).colors.find { |c| c.name == name }.try(:hex) || "nil"
|
||||
end
|
||||
|
||||
def self.hex_for_name(name)
|
||||
hex_cache[name] ||= lookup_hex_for_name(name)
|
||||
hex_cache[name] == :nil ? nil : hex_cache[name]
|
||||
hex_cache[name] == "nil" ? nil : hex_cache[name]
|
||||
end
|
||||
|
||||
def colors=(arr)
|
||||
|
||||
Reference in New Issue
Block a user