mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Ensure live-reloading of theme CSS works first time (#8052)
The client-side theme-selector would always apply the first in a series of file change notifications. This has been fixed, so it now applies the most recent notification. Duplicate notifications were being sent because - The remote_theme autosave was causing every change notification to be doubled - Color scheme change notifications were being sent every time a theme was uploaded, even if the colors were unchanged These duplicate notifications have been fixed, and a spec added to ensure it does not regress in future
This commit is contained in:
@@ -22,7 +22,7 @@ class Theme < ActiveRecord::Base
|
||||
has_many :child_themes, -> { order(:name) }, through: :child_theme_relation, source: :child_theme
|
||||
has_many :parent_themes, -> { order(:name) }, through: :parent_theme_relation, source: :parent_theme
|
||||
has_many :color_schemes
|
||||
belongs_to :remote_theme, autosave: true, dependent: :destroy
|
||||
belongs_to :remote_theme, dependent: :destroy
|
||||
|
||||
has_one :settings_field, -> { where(target_id: Theme.targets[:settings], name: "yaml") }, class_name: 'ThemeField'
|
||||
has_one :javascript_cache, dependent: :destroy
|
||||
|
||||
Reference in New Issue
Block a user