mirror of
https://github.com/discourse/discourse.git
synced 2025-04-29 13:34:33 +08:00
FIX: sets categoryId but do not scope when replying as new topic (#7002)
This commit is contained in:
parent
fe4254b8f3
commit
560cc4e73e
@ -783,7 +783,11 @@ export default Ember.Controller.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Scope the categories drop down to the category we opened the composer with.
|
// Scope the categories drop down to the category we opened the composer with.
|
||||||
if (opts.categoryId && opts.draftKey !== "reply_as_new_topic") {
|
if (
|
||||||
|
opts.categoryId &&
|
||||||
|
opts.draftKey !== "reply_as_new_topic" &&
|
||||||
|
!opts.disableScopedCategory
|
||||||
|
) {
|
||||||
const category = this.site.categories.findBy("id", opts.categoryId);
|
const category = this.site.categories.findBy("id", opts.categoryId);
|
||||||
if (category) {
|
if (category) {
|
||||||
this.set("scopedCategoryId", opts.categoryId);
|
this.set("scopedCategoryId", opts.categoryId);
|
||||||
|
@ -242,6 +242,7 @@ export default DropdownSelectBoxComponent.extend({
|
|||||||
replyAsNewTopicSelected(options) {
|
replyAsNewTopicSelected(options) {
|
||||||
options.action = CREATE_TOPIC;
|
options.action = CREATE_TOPIC;
|
||||||
options.categoryId = this.get("composerModel.topic.category.id");
|
options.categoryId = this.get("composerModel.topic.category.id");
|
||||||
|
options.disableScopedCategory = true;
|
||||||
this._replyFromExisting(options, _postSnapshot, _topicSnapshot);
|
this._replyFromExisting(options, _postSnapshot, _topicSnapshot);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -295,7 +296,12 @@ export default DropdownSelectBoxComponent.extend({
|
|||||||
if (this[action]) {
|
if (this[action]) {
|
||||||
let model = this.get("composerModel");
|
let model = this.get("composerModel");
|
||||||
this[action](
|
this[action](
|
||||||
model.getProperties("draftKey", "draftSequence", "reply"),
|
model.getProperties(
|
||||||
|
"draftKey",
|
||||||
|
"draftSequence",
|
||||||
|
"reply",
|
||||||
|
"disableScopedCategory"
|
||||||
|
),
|
||||||
model
|
model
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user