mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 18:36:35 +08:00
FIX: removes uncategorized context if not allowed in composer (#7922)
This commit is contained in:
parent
4bc5ccf7e4
commit
8a9ce7336d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user