FIX: keep tag filter value when changing the category dropdown. (#11065)

Previously, while filtering the topics by tag, selecting a category loses the selected tag value.
This commit is contained in:
Vinoth Kannan 2020-10-30 06:26:20 +05:30 committed by GitHub
parent b2847e3753
commit 2d5bb516a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,7 @@
{{category-drop
category=breadcrumb.category
categories=breadcrumb.options
tagId=tagId
options=(hash
parentCategory=breadcrumb.parentCategory
subCategory=breadcrumb.isSubcategory

View File

@ -161,7 +161,14 @@ export default ComboBoxComponent.extend({
onChange(categoryId) {
let categoryURL;
if (categoryId === ALL_CATEGORIES_ID) {
if (this.tagId && !this.category) {
const category = Category.findById(parseInt(categoryId, 10));
categoryURL = getURL(
`/tags/c/${Category.slugFor(category)}/${
category.id
}/${this.tagId.toLowerCase()}`
);
} else if (categoryId === ALL_CATEGORIES_ID) {
categoryURL = this.allCategoriesUrl;
} else if (categoryId === NO_CATEGORIES_ID) {
categoryURL = this.noCategoriesUrl;