DEV: Refactor discover setting reporting (#26706)

This commit is contained in:
Penar Musaraj
2024-04-23 09:52:01 -04:00
committed by GitHub
parent e1d9fd479f
commit 98d400f7b5
5 changed files with 17 additions and 24 deletions

View File

@ -36,20 +36,14 @@ class SiteController < ApplicationController
header_primary_color: ColorScheme.hex_for_name("header_primary") || "333333",
header_background_color: ColorScheme.hex_for_name("header_background") || "ffffff",
login_required: SiteSetting.login_required,
locale: SiteSetting.default_locale,
include_in_discourse_discover: SiteSetting.include_in_discourse_discover,
}
if mobile_logo_url = SiteSetting.site_mobile_logo_url.presence
results[:mobile_logo_url] = UrlHelper.absolute(mobile_logo_url)
end
if guardian.is_discourse_hub_request?
DiscourseHub.stats_fetched_at = Time.zone.now
discover_data = About.discourse_discover
discover_data.each_key do |key|
results["discourse_discover_#{key}".to_sym] = discover_data[key]
end
end
# this info is always available cause it can be scraped from a 404 page
render json: results
end