Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions app/component/itinerary/navigator/NaviCardContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function NaviCardContainer(
}

// track only relevant vehicles for the journey.
// addd 20 s buffer so that vehicle location is available
// add 20 s buffer so that vehicle location is available
// for leg validation long enough
const getNaviTopics = () =>
getTopics(
Expand Down Expand Up @@ -199,16 +199,13 @@ function NaviCardContainer(
}, [time, firstLeg]);

// LegChange fires animation, we need to keep the old data until card goes out of the view.
const l = legChanging ? previousLeg : currentLeg;
const legType = getLegType(
l,
firstLeg,
time,
nextLeg?.interlineWithPreviousLeg,
);
const cardChanging = legChanged || legChanging;
const l = cardChanging ? previousLeg : currentLeg;
const nl = cardChanging ? currentLeg : nextLeg;
const legType = getLegType(l, firstLeg, time, nl?.interlineWithPreviousLeg);

let className;
if (isJourneyCompleted || legChanging) {
if (isJourneyCompleted || cardChanging) {
className = 'hide-card';
} else {
className = 'show-card';
Expand All @@ -223,7 +220,7 @@ function NaviCardContainer(
>
<NaviCard
leg={l}
nextLeg={nextLeg}
nextLeg={nl}
legType={legType}
time={time}
position={position}
Expand Down
Loading