mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: Hide welcome topic if it hasn't been edited (#18632)
This commit is contained in:
@ -18,6 +18,19 @@ module TopicQueryParams
|
||||
options[:topic_ids] = param_to_integer_list(:topic_ids)
|
||||
options[:no_subcategories] = options[:no_subcategories] == 'true' if options[:no_subcategories].present?
|
||||
|
||||
if hide_welcome_topic?
|
||||
options[:except_topic_ids] ||= []
|
||||
options[:except_topic_ids] << SiteSetting.welcome_topic_id
|
||||
end
|
||||
|
||||
options
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def hide_welcome_topic?
|
||||
return false if !SiteSetting.bootstrap_mode_enabled
|
||||
return false if @guardian.is_admin?
|
||||
Site.welcome_topic_exists_and_is_not_edited?
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user