summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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;