Skip to content

Commit

Permalink
feat: queryset added based on isMapshown for omitmapresults
Browse files Browse the repository at this point in the history
  • Loading branch information
varun2948 committed Feb 14, 2024
1 parent 16dbd94 commit c054519
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion frontend/src/components/projects/projectNav.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';
import { Link, useLocation } from 'react-router-dom';
import { FormattedMessage } from 'react-intl';
import { useSelector, useDispatch } from 'react-redux';
Expand Down Expand Up @@ -84,7 +84,18 @@ export const ProjectNav = (props) => {
const encodedParams = stringify(fullProjectsQuery)
? ['?', stringify(fullProjectsQuery)].join('')
: '';
const isMapShown = useSelector((state) => state.preferences['mapShown']);

useEffect(() => {
setQuery(
{
...fullProjectsQuery,
omitMapResults:!isMapShown
},
'pushIn',
);
// eslint-disable-next-line react-hooks/exhaustive-deps
},[isMapShown])
const linkCombo = 'link ph3 f6 pv2 ba b--tan br1 ph3 fw5';

const moreFiltersAnyActive =
Expand Down

0 comments on commit c054519

Please sign in to comment.