Skip to content

Commit

Permalink
Merge pull request #251 from City-of-Turku/fix/mobility-profiles-max-…
Browse files Browse the repository at this point in the history
…count-bug

Fix max count and icon related bug
  • Loading branch information
juhomakkonen authored Jun 12, 2024
2 parents 48d3f62 + 406044b commit 8ba0e6b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ const MobilityProfiles = () => {
* @returns leaflet icon
*/
const getCorrectIcon = (nameValue, mobilityProfiles) => {
const filteredMobilityProfiles = mobilityProfiles?.filter(item => item.postal_code_string === nameValue);
const filteredMobilityProfiles = mobilityProfiles?.filter(
item => item.postal_code_string === nameValue && item.postal_code_type_string === 'Home',
);
const maxCount = filteredMobilityProfiles?.reduce(
(prev, current) => (prev.count > current.count ? prev : current),
1,
Expand Down

0 comments on commit 8ba0e6b

Please sign in to comment.