UX: always scope the composer categories dropdown to current category

This commit is contained in:
Vinoth Kannan 2019-01-11 01:07:23 +05:30
parent 3e5e6c82be
commit 0744e84604
1 changed files with 2 additions and 7 deletions

View File

@ -754,15 +754,10 @@ export default Ember.Controller.extend({
scopedCategoryId: null
});
// If we show the subcategory list, 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") {
const category = this.site.categories.findBy("id", opts.categoryId);
if (
category &&
(category.get("show_subcategory_list") ||
category.get("parentCategory.show_subcategory_list"))
) {
if (category) {
this.set("scopedCategoryId", opts.categoryId);
}
}