Skip to content

Commit

Permalink
Merge pull request #908 from GlobalFishingWatch/vessel-viewer/fix-reg…
Browse files Browse the repository at this point in the history
…ion-names-in-events

Fix region names in events
  • Loading branch information
rdgfuentes authored Sep 10, 2021
2 parents b88f30e + 2db2a0c commit 291355c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { selectActiveTrackDataviews } from 'features/dataviews/dataviews.selecto
import { ActivityEvent, Regions } from 'types/activity'
import { selectEEZs, selectMPAs, selectRFMOs } from 'features/regions/regions.selectors'
import { getEEZName } from 'utils/region-name-transform'
import { Region } from 'features/regions/regions.slice'
import { Region, RegionId } from 'features/regions/regions.slice'
import { selectSettings } from 'features/settings/settings.slice'
import { filterActivityHighlightEvents } from './vessels-highlight.worker'

Expand Down Expand Up @@ -218,7 +218,7 @@ const getEventRegionDescription = (
)
case 'mpa':
return values
.map((mpaId) => mpas.find((eez) => eez.id.toString() === mpaId)?.label ?? '')
.map((mpaId) => mpas.find((mpa) => mpa.id.toString() === mpaId)?.label ?? '')
.filter((value) => value.length > 0)
.join(', ')
default:
Expand All @@ -236,7 +236,9 @@ const getEventRegionDescription = (
(regionType) =>
`${getRegionNamesByType(
regionType,
event?.regions[regionType].filter((x: string) => x.length > 0)
event?.regions[regionType]
.map((regionId) => `${regionId}`)
.filter((x: string) => x.length > 0)
)}`
)
.pop()
Expand Down

0 comments on commit 291355c

Please sign in to comment.