Skip to content

Commit

Permalink
Added searchTerm to selectedFiltersAndSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkishpolicy committed Feb 20, 2025
1 parent a9fd938 commit 9980901
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/src/components/DrawerInterior.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const DrawerInterior: React.FC<Props> = (props) => {
addFilter,
removeFilter,
facets,
searchTerm,
setSearchTerm,
initialFilters
} = props;
Expand Down Expand Up @@ -125,8 +126,9 @@ export const DrawerInterior: React.FC<Props> = (props) => {
restoreInitialFilters();
};

const selectedFilters = filters.filter(
(filter) => !initialFilters.some((f) => f.field === filter.field)
const selectedFiltersAndSearch = filters.filter(
(filter) =>
!initialFilters.some((f) => f.field === filter.field) || searchTerm
);

const revertSearch = () => {
Expand Down Expand Up @@ -255,7 +257,7 @@ export const DrawerInterior: React.FC<Props> = (props) => {
</Stack>
</Toolbar>

{selectedFilters.length > 0 ? (
{selectedFiltersAndSearch.length > 0 ? (
<>
<Divider />
<Box marginY={1} display="flex" width="100%" justifyContent="center">
Expand Down

0 comments on commit 9980901

Please sign in to comment.