Skip to content

Commit

Permalink
fix port_visit VesselPin
Browse files Browse the repository at this point in the history
  • Loading branch information
j8seangel committed Oct 21, 2024
1 parent 6c4f17e commit f5607b8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions apps/fishing-map/features/map/map.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,21 @@ export const fetchClusterEventThunk = createAsyncThunk(
const vesselInfoIds = vesselInfo.selfReportedInfo?.map((s) => s.id)
return vesselInfoIds.includes(interaction.id)
})
const infoDataset = selectDatasetById(vesselInfo?.dataset as string)(state)
const trackFromRelatedDataset = infoDataset || vesselInfo?.dataset
const trackDatasetId = getRelatedDatasetByType(
trackFromRelatedDataset,
DatasetTypes.Tracks,
{ fullDatasetAllowed: !guestUser }
)?.id
const trackDataset = selectDatasetById(trackDatasetId as string)(state)

return {
id: interaction.id,
...vesselInfo,
dataset: infoDatasets[0] as any,
infoDataset,
trackDataset,
events: interaction.events,
} as ExtendedFeatureVessel
}
Expand Down
5 changes: 4 additions & 1 deletion apps/fishing-map/features/vessel/VesselPin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ function VesselPin({
const dispatch = useAppDispatch()
const { upsertDataviewInstance, deleteDataviewInstance } = useDataviewInstancesConnect()
const vesselsInWorkspace = useSelector(selectTrackDataviews)
const infoDatasetId = vessel?.dataset || vesselToResolve?.datasetId || ''
const infoDatasetId =
typeof vessel?.dataset === 'string'
? vessel?.dataset
: (vessel?.dataset as any)?.id || vesselToResolve?.datasetId || ''
const infoDataset = useSelector(selectDatasetById(infoDatasetId))
const vesselInWorkspace = getVesselInWorkspace(
vesselsInWorkspace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export class FourwingsClustersLayer extends CompositeLayer<
subcategory: this.props.subcategory,
startTime: this.props.startTime,
endTime: this.props.endTime,
eventType: this.props.eventType,
uniqueFeatureInteraction: true,
expansionZoom,
}
Expand Down

0 comments on commit f5607b8

Please sign in to comment.