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

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

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 0fd2d18..3fa4470 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;

GitHub sha: 25269a37

1 Like

uncategorized is the gift that never stops giving :weary::sob:

2 Likes