summaryrefslogtreecommitdiff
path: root/lib/Travelynx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travelynx')
-rw-r--r--lib/Travelynx/Command/work.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Travelynx/Command/work.pm b/lib/Travelynx/Command/work.pm
index 405716c..9658ff6 100644
--- a/lib/Travelynx/Command/work.pm
+++ b/lib/Travelynx/Command/work.pm
@@ -134,7 +134,15 @@ sub run {
checkout_station_id => $arr
}
);
- $self->app->add_route_timestamps( $uid, $train, 0 );
+ if ( $train->arrival_is_cancelled ) {
+
+ # check out (adds a cancelled journey and resets journey state
+ # to destination selection)
+ $self->app->checkout( $arr, 0, $uid );
+ }
+ else {
+ $self->app->add_route_timestamps( $uid, $train, 0 );
+ }
}
elsif ( $entry->{real_arr_ts} ) {
my ( undef, $error ) = $self->app->checkout( $arr, 1, $uid );