Skip to content

Commit

Permalink
Release-2025-01-23-Hotfix (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannaPeanut authored Jan 23, 2025
2 parents 192d0a5 + 1e9c07a commit dd794f0
Showing 1 changed file with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,24 @@ const EditableSurveyResponseMapAndStaticData = ({
}
}

// @ts-expect-error `data` is unkown
const atlasUrl = response.data[userLocationQuestionId]
? surveyDefinition.atlasUrl!.replace(
"MAPPARAM",
// @ts-expect-error `data` is unkown
`11%2F${response.data[userLocationQuestionId].lat.toFixed(3)}%2F${response.data[userLocationQuestionId].lng.toFixed(3)}`,
)
: surveyDefinition.atlasUrl!.replace(
"MAPPARAM",
// @ts-expect-error `data` is unkown
`11%2F${center(getParsedLine(response.data[geometryCategoryId])).geometry.coordinates[1].toFixed(3)}%2F${center(getParsedLine(response.data[geometryCategoryId])).geometry.coordinates[0].toFixed(3)}`,
)
const atlasUrl = surveyDefinition.atlasUrl
? // @ts-expect-error `data` is unkown
response.data[userLocationQuestionId]
? surveyDefinition.atlasUrl.replace(
"MAPPARAM",
// @ts-expect-error `data` is unkown
`11%2F${response.data[userLocationQuestionId].lat.toFixed(3)}%2F${response.data[userLocationQuestionId].lng.toFixed(3)}`,
)
: surveyDefinition.atlasUrl.replace(
"MAPPARAM",
// @ts-expect-error `data` is unkown
`11%2F${center(getParsedLine(response.data[geometryCategoryId])).geometry.coordinates[1].toFixed(3)}%2F${center(getParsedLine(response.data[geometryCategoryId])).geometry.coordinates[0].toFixed(3)}`,
)
: null

return (
<div className={clsx("grid gap-6 md:gap-4", showMap && "md:grid-cols-2")}>
{surveyDefinition.atlasUrl && !showMap && (
{atlasUrl && !showMap && (
<Link target="_blank" href={atlasUrl}>
Im Radverkehrsatlas öffnen
</Link>
Expand Down Expand Up @@ -217,7 +219,7 @@ const EditableSurveyResponseMapAndStaticData = ({
>
In großer Karte öffnen
</Link>
{surveyDefinition.atlasUrl && (
{atlasUrl && (
<Link target="_blank" href={atlasUrl}>
Im Radverkehrsatlas öffnen
</Link>
Expand Down

0 comments on commit dd794f0

Please sign in to comment.