Skip to content

Commit

Permalink
Merge pull request #2309 from Plant-for-the-Planet-org/hotfix/map-fly…
Browse files Browse the repository at this point in the history
…to-issue

fix: avoid returning to the map center after selecting a project from…
  • Loading branch information
mohitb35 authored Nov 20, 2024
2 parents 6fe12be + 011f4fd commit 00673aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/features/projectsV2/ProjectsMap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ function ProjectsMap(props: ProjectsMapProps) {
filteredProjects.length > 0 &&
(filteredProjects.length < 30 ||
filteredProjects.length === projects?.length) &&
map !== null;
if (!shouldCenterMap) return;
map !== null &&
props.page === 'project-list';

if (!shouldCenterMap) return;
const validFeatures = getValidFeatures(filteredProjects);
if (validFeatures.length === 0) return;

Expand Down

0 comments on commit 00673aa

Please sign in to comment.