Skip to content

Commit

Permalink
fixup! Persist selected filters in checks results inside Redux
Browse files Browse the repository at this point in the history
  • Loading branch information
dottorblaster committed May 25, 2023
1 parent f23a786 commit 7c62a09
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion assets/js/components/ExecutionResults/ExecutionResults.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ import CheckResultOutline from './CheckResultOutline';
import ExecutionHeader from './ExecutionHeader';
import ExecutionContainer from './ExecutionContainer';

// To have an array as a default prop that is also used in a useEffect's dependency
// array we need to declare it outside the scope as a `const`, in order to prevent
// rerendering loops.
//
// https://github.com/facebook/react/issues/18123
const defaultSavedFilters = [];

const resultsTableConfig = {
usePadding: false,
rowClassName: 'tn-check-result-row',
Expand Down Expand Up @@ -101,7 +108,7 @@ function ExecutionResults({
executionData,
executionError,
clusterSelectedChecks = [],
savedFilters,
savedFilters = defaultSavedFilters,
onCatalogRefresh = () => {},
onLastExecutionUpdate = () => {},
onStartExecution = () => {},
Expand Down

0 comments on commit 7c62a09

Please sign in to comment.