Skip to content

Commit fde3769

Browse files
authored
fix: Legacy filters without filterId do not appear in sidebar (#2945)
1 parent 3516b52 commit fde3769

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/CategoryList/CategoryList.react.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,11 @@ export default class CategoryList extends React.Component {
168168
{this.state.openClasses.includes(id) &&
169169
c.filters.map((filterData, index) => {
170170
const { name, filter, id } = filterData;
171-
const url = `${this.props.linkPrefix}${c.name}?filters=${encodeURIComponent(
172-
filter
173-
)}&filterId=${id}`;
171+
// Only include filterId in URL if the filter has an ID (modern filters)
172+
// Legacy filters without ID should work with just the filter content
173+
const url = id
174+
? `${this.props.linkPrefix}${c.name}?filters=${encodeURIComponent(filter)}&filterId=${id}`
175+
: `${this.props.linkPrefix}${c.name}?filters=${encodeURIComponent(filter)}`;
174176
return (
175177
<div key={index} className={styles.childLink}>
176178
<Link

0 commit comments

Comments
 (0)