From 7bc6d7ce1420de580510775b5c748194b2b84b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Jyrki=C3=A4inen?= Date: Mon, 2 Dec 2024 15:42:53 +0200 Subject: [PATCH] fix search event selected time change --- src/components/sidepanel/SpeedAreaJourneyList.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/sidepanel/SpeedAreaJourneyList.js b/src/components/sidepanel/SpeedAreaJourneyList.js index df66b81a..2cfd3900 100644 --- a/src/components/sidepanel/SpeedAreaJourneyList.js +++ b/src/components/sidepanel/SpeedAreaJourneyList.js @@ -131,15 +131,13 @@ const SpeedAreaJourneyList = decorate( if (journeyId && selectedJourneyId !== journeyId) { journey.departureDate = date; Journey.setSelectedJourney(journey); + const time = get(journey, "recordedTime"); + if (time) { + Time.setTime(time); + } } else { Journey.setSelectedJourney(null); } - } else if (journey.journeyType !== "journey") { - const time = get(journey, "vehiclePositions[0].recordedTime"); - console.log(time); - if (time) { - Time.setTime(time); - } } }, [selectedJourneyId]