Skip to content

Commit

Permalink
fix: Empty selection not persisted, and simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
amattu2 committed Feb 3, 2025
1 parent 7b52a48 commit 368abe0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/DataSubmissions/DataSubmissionListFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,15 @@ const DataSubmissionListFilters = ({
} else if (orgFilter === "All") {
newSearchParams.delete("program");
}
if (statusFilter && statusFilter.length > 0) {
if (statusFilter?.length > 0) {
newSearchParams.delete("status");
if (!isArrayEqual(statusFilter, defaultValues.status)) {
statusFilter.forEach((status) => {
newSearchParams.append("status", status);
});
}
} else if (!statusFilter || !statusFilter.length) {
newSearchParams.delete("status");
} else {
newSearchParams.set("status", "");
}
if (dataCommonsFilter && dataCommonsFilter !== "All") {
newSearchParams.set("dataCommons", dataCommonsFilter);
Expand Down

0 comments on commit 368abe0

Please sign in to comment.