Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#175 Map does not focus on pin when visiting institution details page from direct link #176

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ Project backlog is available in [Github Projects](https://github.com/users/kubaw
* [x] Add Google Analytics
* [ ] Comparison view
* [ ] Performance upgrades
* [ ] Quick filters with cities
* [ ] Direct URLs to filtered cities
* [x] Feedback form v1 (report data error, suggest change)
* [x] *About* page content
* [x] Display hour price when monthly not provided
Expand Down Expand Up @@ -206,6 +208,7 @@ Project backlog is available in [Github Projects](https://github.com/users/kubaw
* [x] City dropdown is not filtered based on voivodeship
* [x] Voivodeship is not automatically selected on city dropdown change
* [ ] If filters selected on list view, map pin is not displayed on details view when redirected from autocomplete
* [x] Map does not focus on pin when visiting institution details page from direct link

## Data source

Expand Down
7 changes: 6 additions & 1 deletion src/nursery-nav/src/components/MapComponent/MapComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ export default function MapComponent() {
}, []);

useEffect(() => {
setLocationsFiltered(locations.filter((location) => institutionIds.includes(location.id)));
if (institutionIds.length === 0) {
setLocationsFiltered(locations);
}
else {
setLocationsFiltered(locations.filter((location) => institutionIds.includes(location.id)));
}
}, [institutionIds, locations]);

return (
Expand Down
Loading