summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller/Traveling.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2023-01-18 18:13:35 +0100
committerDaniel Friesel <derf@finalrewind.org>2023-01-18 18:13:35 +0100
commite9373246175a0853fb56aff4a740f4db7dda7215 (patch)
tree0cde9fbc35979d15bb9636d50004f28782c29b24 /lib/Travelynx/Controller/Traveling.pm
parenteb1ed1bb48d54077930d015144636f90b2fc9c15 (diff)
landing page: show past stops if geolocation is unavailable
Diffstat (limited to 'lib/Travelynx/Controller/Traveling.pm')
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index 9d32c86..357e3bd 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -376,6 +376,7 @@ sub homepage {
my ($self) = @_;
if ( $self->is_user_authenticated ) {
my $status = $self->get_user_status;
+ my @recent_targets;
if ( $status->{checked_in} ) {
if ( defined $status->{arrival_countdown}
and $status->{arrival_countdown} < ( 40 * 60 ) )
@@ -414,10 +415,15 @@ sub homepage {
return;
}
}
+ else {
+ @recent_targets = $self->journeys->get_latest_checkout_stations(
+ uid => $self->current_user->{id} );
+ }
$self->render(
'landingpage',
version => $self->app->config->{version} // 'UNKNOWN',
user_status => $status,
+ recent_targets => \@recent_targets,
with_autocomplete => 1,
with_geolocation => 1
);