Skip to content

Commit

Permalink
Fix maturity filter in mobile device
Browse files Browse the repository at this point in the history
Signed-off-by: Cintia Sanchez Garcia <[email protected]>
  • Loading branch information
cynthia-sg committed Feb 9, 2024
1 parent f9a57b7 commit 91048a2
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions web/src/layout/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const Search = () => {

const onResetFilters = (): void => {
setSelectedFoundation(null);
setFilters(cleanFilters);
navigate({
pathname: '/search',
search: prepareQueryString({
Expand Down Expand Up @@ -229,8 +230,10 @@ const Search = () => {
: null;

if (foundationActive) {
prepareFilters(foundationActive, fullFilters, filtersExtra);
setSelectedFoundation(foundationActive);
} else {
setFilters(cleanFilters);
setSelectedFoundation(null);
}

Expand Down Expand Up @@ -271,17 +274,6 @@ const Search = () => {
}, [searchParams, limit, sort.by]);
/* eslint-enable react-hooks/exhaustive-deps */

useEffect(() => {
if (!isUndefined(cleanFilters)) {
if (isNull(selectedFoundation)) {
setFilters(cleanFilters);
} else {
prepareFilters(selectedFoundation, fullFilters, filtersExtra);
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectedFoundation]);

return (
<>
{/* Subnavbar */}
Expand Down

0 comments on commit 91048a2

Please sign in to comment.