Fix filter reset
@@ -55,19 +55,23 @@ export default class FilterContainer extends React.PureComponent {
}
resetAllFilters() {
+ const setFilters = this.state.filters.filter((item) => item.filtering);
const newFilterState = this.state.filters.map((filter) => ({
...filter,
filtering: false,
values: [],
}));
this.setState({ filters: [...newFilterState] });
- for (const filter of newFilterState) {
+ console.log([...setFilters]);
+ for (const filter of setFilters) {
+ if (filter.values) {
this.props.updateFilters(
{ title: filter.display_title, values: [] },
filter.idx,
);
}
}
+ }
removeFilter(idx, title) {
const newFilterState = this.state.filters;
