mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 05:52:49 +08:00
Fix an error with mobile custom header
This commit is contained in:
parent
13f17b2a5c
commit
c845071066
|
@ -87,7 +87,7 @@ class SiteCustomization < ActiveRecord::Base
|
|||
def self.custom_header(preview_style, target=:desktop)
|
||||
preview_style ||= enabled_style_key
|
||||
style = lookup_style(preview_style)
|
||||
if style && ((target == :mobile && style.mobile_header) || style.header)
|
||||
if style && ((target != :mobile && style.header) || (target == :mobile && style.mobile_header))
|
||||
target == :mobile ? style.mobile_header.html_safe : style.header.html_safe
|
||||
else
|
||||
""
|
||||
|
|
|
@ -7,7 +7,7 @@ describe SiteCustomization do
|
|||
end
|
||||
|
||||
let :customization_params do
|
||||
{name: 'my name', user_id: user.id, header: "my awesome header", stylesheet: "my awesome css", mobile_stylesheet: '', mobile_header: ''}
|
||||
{name: 'my name', user_id: user.id, header: "my awesome header", stylesheet: "my awesome css", mobile_stylesheet: nil, mobile_header: nil}
|
||||
end
|
||||
|
||||
let :customization do
|
||||
|
|
Loading…
Reference in New Issue
Block a user