From 25269a37aa240f59c7929afd5c386d9050016614 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 9 Jan 2019 02:44:24 +0100 Subject: [PATCH] FIX: do not show #uncategorized in category drop if setting is disabled (#6856) --- .../select-kit/components/category-drop.js.es6 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/assets/javascripts/select-kit/components/category-drop.js.es6 b/app/assets/javascripts/select-kit/components/category-drop.js.es6 index 0fd2d187514..3fa4470e96c 100644 --- a/app/assets/javascripts/select-kit/components/category-drop.js.es6 +++ b/app/assets/javascripts/select-kit/components/category-drop.js.es6 @@ -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;