mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 13:06:56 +08:00
DEV: Extract theme resolution to a helper (#27426)
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.
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class HomepageHelper
|
||||
def self.resolve(request = nil, current_user = nil)
|
||||
return "custom" if ThemeModifierHelper.new(request: request).custom_homepage
|
||||
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
|
||||
|
Reference in New Issue
Block a user