fix: edge case in category filter

selecting a category and then clicking on all categories was breaking selection icons
This commit is contained in:
Barış Soner Uşaklı
2023-05-18 13:44:59 -04:00
parent 160b891979
commit 5daaa5ea78
2 changed files with 13 additions and 4 deletions

View File

@@ -129,7 +129,8 @@ searchController.search = async function (req, res, next) {
),
},
categories: {
active: !!(Array.isArray(data.categories) && data.categories.length),
active: !!(Array.isArray(data.categories) && data.categories.length &&
(data.categories.length > 1 || data.categories[0] !== 'all')),
label: await buildSelectedCategoryLabel(searchData.selectedCids),
},
};