Skip to content

Commit

Permalink
fix country route hints for single border
Browse files Browse the repository at this point in the history
  • Loading branch information
karussell committed Apr 2, 2024
1 parent 0d1a83c commit eaec690
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/sidebar/RoutingResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function RoutingResult({
const getOffBikeInfo = !ApiImpl.isBikeLike(profile)
? new RouteInfo()
: getInfoFor(path.points, path.details.get_off_bike, s => s)
const countriesInfo = crossesBorderInfo(path.points, path.details.country)
const borderInfo = crossesBorderInfo(path.points, path.details.country)

const showHints =
fordInfo.distance > 0 ||
Expand All @@ -116,7 +116,7 @@ function RoutingResult({
trunkInfo.distance > 0 ||
badTrackInfo.distance > 0 ||
stepsInfo.distance > 0 ||
countriesInfo.values.length > 1 ||
borderInfo.values.length > 0 ||
getOffBikeInfo.distance > 0 ||
steepInfo.distance > 0

Expand Down Expand Up @@ -183,12 +183,12 @@ function RoutingResult({
setDescription={b => setDescriptionRH(b)}
description={tr('way_crosses_border')}
setType={t => setSelectedRH(t)}
type={'country'}
type={'border'}
child={<BorderCrossingIcon />}
value={countriesInfo.values.length > 1 && countriesInfo.values[0]}
value={borderInfo.values.length > 0 && borderInfo.values[0]}
selected={selectedRH}
segments={countriesInfo.segments}
values={countriesInfo.values}
segments={borderInfo.segments}
values={borderInfo.values}
/>
<RHButton
setDescription={b => setDescriptionRH(b)}
Expand Down Expand Up @@ -365,7 +365,7 @@ function RHButton(p: {
p.setType(p.type)
let tmpDescription
if (p.type == 'get_off_bike') tmpDescription = p.description
else if (p.type == 'country') tmpDescription = p.description + ': ' + p.values[index]
else if (p.type == 'border') tmpDescription = p.description + ': ' + p.values[index]
else if (p.values && p.values[index])
tmpDescription = p.description + ': ' + p.value + ' ' + p.values[index]
else tmpDescription = p.description + ': ' + p.value
Expand Down

0 comments on commit eaec690

Please sign in to comment.