mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
Don't show uncategorized in hamburger menu if it's empty, unless you're staff
This commit is contained in:
@ -22,7 +22,14 @@ Discourse.SiteMapController = Ember.ArrayController.extend(Discourse.HasCurrentU
|
||||
}.property(),
|
||||
|
||||
categories: function() {
|
||||
return Discourse.Category.list();
|
||||
if (Discourse.SiteSettings.allow_uncategorized_topics) {
|
||||
return Discourse.Category.list();
|
||||
} else {
|
||||
// Exclude the uncategorized category if it's empty
|
||||
return Discourse.Category.list().reject(function(c) {
|
||||
return c.get('isUncategorizedCategory') && !Discourse.User.currentProp('staff');
|
||||
});
|
||||
}
|
||||
}.property(),
|
||||
|
||||
actions: {
|
||||
|
Reference in New Issue
Block a user