From a9156b60bbcba54fcaf5c69d0ffce4b0c338093a Mon Sep 17 00:00:00 2001 From: sharhio Date: Thu, 11 Dec 2025 15:00:44 +0200 Subject: [PATCH 1/2] reset previous platform between leg changes --- .../itinerary/navigator/NaviCardContainer.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/component/itinerary/navigator/NaviCardContainer.js b/app/component/itinerary/navigator/NaviCardContainer.js index b9a9a684d3..bdafd92b29 100644 --- a/app/component/itinerary/navigator/NaviCardContainer.js +++ b/app/component/itinerary/navigator/NaviCardContainer.js @@ -69,12 +69,11 @@ function NaviCardContainer( const focusRef = useRef(false); const { intl, config, match, router } = context; - - const nextLegPlatformCode = nextLeg?.from?.stop?.platformCode; - const platformStatus = getPlatformChangeStatus( - nextLeg, - usePrevious(nextLegPlatformCode).previous, - ); + const nextLegPlatformCode = legChanged + ? undefined + : nextLeg?.from?.stop?.platformCode; + const prev = usePrevious(nextLegPlatformCode).previous; + const platformStatus = getPlatformChangeStatus(nextLeg, prev); const handleRemove = index => { const msg = messages.get(activeMessages[index].id); From 53249f03ec9ea1718bd4de4287f6379341425df7 Mon Sep 17 00:00:00 2001 From: sharhio Date: Mon, 15 Dec 2025 10:49:05 +0200 Subject: [PATCH 2/2] use platformref --- .../itinerary/navigator/NaviCardContainer.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/component/itinerary/navigator/NaviCardContainer.js b/app/component/itinerary/navigator/NaviCardContainer.js index bdafd92b29..da692b2947 100644 --- a/app/component/itinerary/navigator/NaviCardContainer.js +++ b/app/component/itinerary/navigator/NaviCardContainer.js @@ -69,11 +69,18 @@ function NaviCardContainer( const focusRef = useRef(false); const { intl, config, match, router } = context; - const nextLegPlatformCode = legChanged - ? undefined - : nextLeg?.from?.stop?.platformCode; - const prev = usePrevious(nextLegPlatformCode).previous; - const platformStatus = getPlatformChangeStatus(nextLeg, prev); + const platformRef = useRef(); + + if (legChanged) { + platformRef.current = undefined; + } + let platformStatus = PLATFORM_STATUS.NORMAL; + if (nextLeg?.transitLeg) { + platformStatus = getPlatformChangeStatus(nextLeg, platformRef.current); + if (platformStatus === PLATFORM_STATUS.CHANGED) { + platformRef.current = nextLeg.from.stop.platformCode; + } + } const handleRemove = index => { const msg = messages.get(activeMessages[index].id);