DEV: Live-reloading of core/plugin CSS alongside preview_theme_id
In development, we track the last requested theme id, and use that to refresh the correct stylesheet targets. The after_action hook runs on every request, but the preview_theme_id parameter is only sent on the initial HTML request. This commit ensures we only fetch the development theme_id on HTML requests
This commit is contained in:
parent
1de5d10f61
commit
7c494cc631
|
@ -64,7 +64,7 @@ class ApplicationController < ActionController::Base
|
|||
after_action :remember_theme_id
|
||||
|
||||
def remember_theme_id
|
||||
if @theme_ids.present?
|
||||
if @theme_ids.present? && request.format == "html"
|
||||
Stylesheet::Watcher.theme_id = @theme_ids.first if defined? Stylesheet::Watcher
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue