Skip to content

Commit

Permalink
replace mutating state with better check of filters
Browse files Browse the repository at this point in the history
  • Loading branch information
asizemore committed Dec 19, 2024
1 parent 5982792 commit 423446b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,8 @@ function ConfiguredVisualizationGrayOut({
}

// using lodash isEqual to compare two objects
if (!isEqual(filters, currentPlotFilters)) {
// Sometimes filters or currentPlotFilters are undefined. In that case, assume there are no filters applied.
if (!isEqual(filters ?? [], currentPlotFilters ?? [])) {
return (
<>
Open to sync with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ function VolcanoPlotViz(props: VisualizationProps<Options>) {
plotContainerStyleOverrides,
} = props;

// If no filters applied, the currentPlotFilters will be undefined. It should be an empty array.
visualization.descriptor.currentPlotFilters =
visualization.descriptor.currentPlotFilters ?? [];
const studyMetadata = useStudyMetadata();
const { id: studyId } = studyMetadata;
const entities = useStudyEntities(filters);
Expand Down

0 comments on commit 423446b

Please sign in to comment.