FIX: removes uncategorized context if not allowed in composer (#7922)

FIX: removes uncategorized context if not allowed in composer (#7922)

diff --git a/app/assets/javascripts/discourse/mixins/open-composer.js.es6 b/app/assets/javascripts/discourse/mixins/open-composer.js.es6
index e3576cd..7d925ab 100644
--- a/app/assets/javascripts/discourse/mixins/open-composer.js.es6
+++ b/app/assets/javascripts/discourse/mixins/open-composer.js.es6
@@ -3,8 +3,17 @@ import Composer from "discourse/models/composer";
 
 export default Ember.Mixin.create({
   openComposer(controller) {
+    let categoryId = controller.get("category.id");
+    if (
+      categoryId &&
+      controller.category.isUncategorizedCategory &&
+      !this.siteSettings.allow_uncategorized_topics
+    ) {
+      categoryId = null;
+    }
+
     this.controllerFor("composer").open({
-      categoryId: controller.get("category.id"),
+      categoryId,
       action: Composer.CREATE_TOPIC,
       draftKey: controller.get("model.draft_key") || Composer.CREATE_TOPIC,
       draftSequence: controller.get("model.draft_sequence") || 0

GitHub sha: 8a9ce733