Skip to content

Commit

Permalink
fix: Crash after setting filter using context menu and opening filter…
Browse files Browse the repository at this point in the history
…s panel (#2579)
  • Loading branch information
404-html authored Jul 11, 2024
1 parent 9db890f commit 5a690eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/BrowserCell/BrowserCell.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ export default class BrowserCell extends Component {

pickFilter(constraint, addToExistingFilter) {
const definition = Filters.Constraints[constraint];
const { filters, type, value, field } = this.props;
const { filters, type, value, field, className } = this.props;
const newFilters = addToExistingFilter ? filters : new List();
let compareTo;
if (definition.comparable) {
Expand Down Expand Up @@ -535,6 +535,7 @@ export default class BrowserCell extends Component {
field,
constraint,
compareTo,
class: className
})
)
);
Expand Down
7 changes: 6 additions & 1 deletion src/dashboard/Data/Browser/Browser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,12 @@ class Browser extends DashboardView {
const query = new URLSearchParams(props.location.search);
if (query.has('filters')) {
const queryFilters = JSON.parse(query.get('filters'));
queryFilters.forEach(filter => (filters = filters.push(new Map(filter))));
queryFilters.forEach(
filter =>
(filters = filters.push(
new Map({ ...filter, class: filter.class || props.params.className })
))
);
}
return filters;
}
Expand Down

0 comments on commit 5a690eb

Please sign in to comment.