Skip to content

Commit

Permalink
Update plugin sorting mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
angusmcleod committed Jul 31, 2024
1 parent 7b778cb commit cd7c29e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
enabled_site_setting :subscription_server_enabled

DiscourseEvent.on(:after_plugin_activation) do
sorted_pugins = Discourse.plugins.sort_by do |p|
p&.name == 'discourse-subscription-server' ? 1 : 0
server_plugin, plugins = Discourse.plugins.partition do |p|
p&.name == 'discourse-subscription-server'
end
Discourse.instance_variable_set(:@plugins, sorted_pugins)
Discourse.instance_variable_set(:@plugins, plugins + server_plugin)
end

after_initialize do
Expand Down

0 comments on commit cd7c29e

Please sign in to comment.