Skip to content

Commit

Permalink
fix(map-popup): prevent null closepopup, fix ids
Browse files Browse the repository at this point in the history
  • Loading branch information
amy-corson-ibigroup committed Sep 16, 2024
1 parent dc9c14e commit 708ef00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/map-popup/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function entityIsStation(entity: Entity): entity is Station {
/**
* Renders a map popup for a stop, scooter, or shared bike
*/
export function MapPopup({ closePopup = null, configCompanies, entity, getEntityName, setLocation, setViewedStop }: Props): JSX.Element {
export function MapPopup({ closePopup = () => null, configCompanies, entity, getEntityName, setLocation, setViewedStop }: Props): JSX.Element {
const intl = useIntl()
if (!entity) return <></>

Expand All @@ -115,7 +115,7 @@ export function MapPopup({ closePopup = null, configCompanies, entity, getEntity
const stopId = !bikesAvailablePresent && entity?.code || entity.id.split(":")[1] || entity.id

// Double quotes make the query invalid, so remove them from the id just in case
const id = `focus-${entity.id}-popup`.replace(/"/g, "")
const id = `focus-${encodeURIComponent(entity.id).replace(/%/g, "")}-popup`

return (
<Styled.MapOverlayPopup>
Expand Down

0 comments on commit 708ef00

Please sign in to comment.