Skip to content

A platform for community discussion. Free, open, simple.

DEV: watch for changes to plugin mobile/desktop SCSS

Penar Musaraj2d84bea6537a
diff --git a/lib/stylesheet/watcher.rb b/lib/stylesheet/watcher.rb
index 7c56afbb8ca..4c9ab7f595c 100644
--- a/lib/stylesheet/watcher.rb
+++ b/lib/stylesheet/watcher.rb
@@ -109,7 +109,13 @@ module Stylesheet
def plugin_assets_refresh(plugin_name)
Stylesheet::Manager.clear_plugin_cache!(plugin_name)
- message = Stylesheet::Manager.stylesheet_data(plugin_name.to_sym, Stylesheet::Watcher.theme_id)
+ targets = [plugin_name]
+ targets.push("#{plugin_name}_mobile") if DiscoursePluginRegistry.stylesheets_exists?(plugin_name, :mobile)
+ targets.push("#{plugin_name}_desktop") if DiscoursePluginRegistry.stylesheets_exists?(plugin_name, :desktop)
+
+ message = targets.map! do |name|
+ Stylesheet::Manager.stylesheet_data(name.to_sym, Stylesheet::Watcher.theme_id)
+ end.flatten!
MessageBus.publish '/file-change', message
end