FIX: do not show #uncategorized in category drop if setting is disabled (#6856)

This commit is contained in:
Joffrey JAFFEUX 2019-01-09 02:44:24 +01:00 committed by Guo Xiang Tan
parent 6e7b383ed6
commit 25269a37aa

View File

@ -159,6 +159,16 @@ export default ComboBoxComponent.extend({
}
let results = Discourse.Category.search(filter);
if (!this.siteSettings.allow_uncategorized_topics) {
results = results.filter(result => {
return (
result.id !==
Discourse.Site.currentProp("uncategorized_category_id")
);
});
}
results = results.sort((a, b) => {
if (a.parent_category_id && !b.parent_category_id) {
return 1;