Skip to content

Commit

Permalink
Merge pull request #87 from adobecom/mwpw-160143-arbitrary-fix
Browse files Browse the repository at this point in the history
MWPW-160143 - arbitrary fix
  • Loading branch information
draganatrajkovic authored Oct 10, 2024
2 parents 847b508 + 194e064 commit 85e7b26
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions edsdme/components/PartnerCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,12 +521,13 @@ export default class PartnerCards extends LitElement {
}
// eslint-disable-next-line consistent-return
return selectedFiltersKeys.every((key) => cardArbitraryArr.some((arbitraryTag) => {
if (!arbitraryTag.value || !arbitraryTag.key) return false;
const arbitraryTagKeyStr = arbitraryTag.key.trim().toLowerCase().replaceAll(' ', '-');
const arbitraryTagValueStr = arbitraryTag.value.trim().toLowerCase().replaceAll(' ', '-');
if (key === arbitraryTagKeyStr) {
const arbitraryTagKey = Object.keys(arbitraryTag)[0]?.replaceAll(' ', '-');
if (arbitraryTagKey !== key) return false;

const arbitraryTagValue = arbitraryTag[key].replaceAll(' ', '-');
if (arbitraryTagValue) {
// eslint-disable-next-line max-len
return this.selectedFilters[key].some((selectedTag) => selectedTag.key === arbitraryTagValueStr);
return this.selectedFilters[key].some((selectedTag) => selectedTag.key === arbitraryTagValue);
}
return false;
}));
Expand Down

0 comments on commit 85e7b26

Please sign in to comment.