mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 01:54:41 +08:00
FEATURE: Enable auto dark mode on new instances (#14208)
This commit is contained in:
@ -18,4 +18,12 @@ if !Theme.exists?
|
||||
name = I18n.t('color_schemes.default_theme_name')
|
||||
default_theme = Theme.create!(name: name, user_id: -1)
|
||||
default_theme.set_default!
|
||||
|
||||
if SiteSetting.default_dark_mode_color_scheme_id == SiteSetting.defaults[:default_dark_mode_color_scheme_id]
|
||||
dark_scheme_id = ColorScheme.where(base_scheme_id: "Dark").pluck_first(:id)
|
||||
|
||||
if dark_scheme_id.present?
|
||||
SiteSetting.default_dark_mode_color_scheme_id = dark_scheme_id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user