Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const TASCheckboxTree = () => {
const checkedFromHash = useSelector((state) => state.appliedFilters.filters.tasCodes.require);
const uncheckedFromHash = useSelector((state) => state.appliedFilters.filters.tasCodes.exclude);
const countsFromHash = useSelector((state) => state.appliedFilters.filters.tasCodes.counts);
// const filters = useSelector((state) => state.appliedFilters.filter);

const request = useRef(null);
const dispatch = useDispatch();
Expand Down Expand Up @@ -113,9 +112,7 @@ const TASCheckboxTree = () => {
tasNodes
);

dispatch(setExpandedTas(
expandTasNodeAndAllDescendantParents(searchExpandedNodes), 'SET_SEARCHED_EXPANDED')
);
dispatch(setExpandedTas(searchExpandedNodes, 'SET_SEARCHED_EXPANDED'));

if (tasNodes.length === 0) {
setShowNoResults(true);
Expand All @@ -133,7 +130,7 @@ const TASCheckboxTree = () => {
modChecked = [...filteredChecked, ...tasNodes.map((child) => child.value)];
}

const newChecked = checked.includes(`children_of_${key}`)
const newChecked = modChecked?.length
? autoCheckTasAfterExpand(
{ children: tasNodes, value: key },
modChecked,
Expand Down
2 changes: 1 addition & 1 deletion src/js/helpers/tasHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
export const isAgency = (tasNode) => tasNode.ancestors.length === 0;
export const shouldTasNodeHaveChildren = (node) => {
if (node.isPlaceHolder) return false;
return node.ancestors.length < 2;
return node.ancestors?.length < 2;
};

export const tasSortFn = (a, b) => {
Expand Down