mirror of
https://github.com/discourse/discourse.git
synced 2026-08-14 06:55:03 -05:00
FEATURE: Demote muted categories on category list (#9226)
This commit is contained in:
@@ -23,6 +23,7 @@ class CategoryList
|
||||
find_user_data
|
||||
sort_unpinned
|
||||
trim_results
|
||||
demote_muted
|
||||
|
||||
if preloaded_topic_custom_fields.present?
|
||||
displayable_topics = @categories.map(&:displayable_topics)
|
||||
@@ -162,6 +163,12 @@ class CategoryList
|
||||
end
|
||||
end
|
||||
|
||||
def demote_muted
|
||||
muted_categories = @categories.select { |category| category.notification_level == 0 }
|
||||
@categories = @categories.reject { |category| category.notification_level == 0 }
|
||||
@categories.concat muted_categories
|
||||
end
|
||||
|
||||
def trim_results
|
||||
@categories.each do |c|
|
||||
next if c.displayable_topics.blank?
|
||||
|
||||
Reference in New Issue
Block a user