mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-07 10:22:48 +00:00
Fix Style/GuardClause
in app/helpers (#35526)
This commit is contained in:
parent
2acc942bb4
commit
e183d7dd9a
|
@ -65,12 +65,12 @@ module FormattingHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def rss_content_preroll(status)
|
def rss_content_preroll(status)
|
||||||
if status.spoiler_text?
|
return unless status.spoiler_text?
|
||||||
safe_join [
|
|
||||||
tag.p { spoiler_with_warning(status) },
|
safe_join [
|
||||||
tag.hr,
|
tag.p { spoiler_with_warning(status) },
|
||||||
]
|
tag.hr,
|
||||||
end
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
def spoiler_with_warning(status)
|
def spoiler_with_warning(status)
|
||||||
|
@ -81,10 +81,10 @@ module FormattingHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def rss_content_postroll(status)
|
def rss_content_postroll(status)
|
||||||
if status.preloadable_poll
|
return unless status.preloadable_poll
|
||||||
tag.p do
|
|
||||||
poll_option_tags(status)
|
tag.p do
|
||||||
end
|
poll_option_tags(status)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -24,24 +24,24 @@ module ThemeHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def custom_stylesheet
|
def custom_stylesheet
|
||||||
if active_custom_stylesheet.present?
|
return if active_custom_stylesheet.blank?
|
||||||
stylesheet_link_tag(
|
|
||||||
custom_css_path(active_custom_stylesheet),
|
stylesheet_link_tag(
|
||||||
host: root_url,
|
custom_css_path(active_custom_stylesheet),
|
||||||
media: :all,
|
host: root_url,
|
||||||
skip_pipeline: true
|
media: :all,
|
||||||
)
|
skip_pipeline: true
|
||||||
end
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def active_custom_stylesheet
|
def active_custom_stylesheet
|
||||||
if cached_custom_css_digest.present?
|
return if cached_custom_css_digest.blank?
|
||||||
[:custom, cached_custom_css_digest.to_s.first(8)]
|
|
||||||
.compact_blank
|
[:custom, cached_custom_css_digest.to_s.first(8)]
|
||||||
.join('-')
|
.compact_blank
|
||||||
end
|
.join('-')
|
||||||
end
|
end
|
||||||
|
|
||||||
def cached_custom_css_digest
|
def cached_custom_css_digest
|
||||||
|
|
Loading…
Reference in New Issue
Block a user