mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 10:33:51 +08:00
33de5abb6e
This ensures that the theme id is resolved as early as possible in the request cycle. This is necessary for the custom homepage to skip preloading the wrong data.
10 lines
275 B
Ruby
10 lines
275 B
Ruby
# frozen_string_literal: true
|
|
|
|
class HomepageHelper
|
|
def self.resolve(theme_id = nil, current_user = nil)
|
|
return "custom" if ThemeModifierHelper.new(theme_ids: theme_id).custom_homepage
|
|
|
|
current_user ? SiteSetting.homepage : SiteSetting.anonymous_homepage
|
|
end
|
|
end
|