summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2026-01-10 05:40:43 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2026-01-10 05:40:43 +0100
commit30205bce4892b3fdaffb33e0c85d38daceeeeb3b (patch)
treea2431312001cdadaca9cb6e223ae229ce16afd98
parentaf1ab5a1fd0a9e07290508df7f68a1ff009387da (diff)
Remove connection suggestions when changing a checkin's destinationHEAD2.18.11main
-rwxr-xr-xlib/Travelynx.pm24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index a83af39..89a0158 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -1461,16 +1461,25 @@ sub startup {
arrival_eva => $new_checkout_station_id
);
- # If in_transit already contains arrival data for another estimated
- # destination, we must invalidate it.
if ( defined $journey->{checkout_station_id}
and $journey->{checkout_station_id}
!= $new_checkout_station_id )
{
+ # If in_transit already contains arrival data for another estimated
+ # destination, we must invalidate it.
$self->in_transit->unset_arrival_data(
uid => $uid,
db => $db
);
+
+ # The same applies to suggestions
+ $self->in_transit->update_data(
+ uid => $uid,
+ db => $db,
+ data => {
+ connection_suggestions_iris => [],
+ },
+ );
}
# Note that a train may pass the same station several times.
@@ -1799,6 +1808,17 @@ sub startup {
cancelled_destination => $found->[0],
);
}
+ else {
+ # remove connection suggestions that may have been saved for a different target station
+ $self->in_transit->update_data(
+ uid => $uid,
+ db => $db,
+ data => {
+ connection_suggestions_dbris => [],
+ connection_suggestions_efa => [],
+ },
+ );
+ }
if ($tx) {
$tx->commit;