Compare commits

..

2 commits

Author SHA1 Message Date
40134331b5 Fix caching parenthesisation 2022-10-23 19:16:28 +00:00
74b7df62b7 Add past trip
TODO: Move these into the envfile
2022-10-23 19:16:04 +00:00
2 changed files with 4 additions and 3 deletions

View file

@ -26,9 +26,10 @@
</header>
<main id="pastTripsList">
<ul>
<ol>
<li><a href="/x8gkdo56o7k3eyp3w2ql">Monkey Run Scotland 2022</a></li>
<li><a href="/47xj8go928ql9mq3r20p">Europespedition III: Leds Free or Die Hard</a></li>
</ul>
</ol>
</main>
</body>
</html>

View file

@ -24,7 +24,7 @@ Route::get('/{tripId?}', function (Request $request, $tripId = null) {
if ($cachedData->trip->is_active) {
$cachedDataUpdatedAt = new DateTime($cachedData->trip->updated_at);
$now = new DateTime();
if (intval(($now->getTimestamp() - $cachedDataUpdatedAt->getTimestamp()) / 3600) <= ($cachedData->trip->is_tracking) ? 1 : 3) {
if (intval(($now->getTimestamp() - $cachedDataUpdatedAt->getTimestamp()) / 3600) <= (($cachedData->trip->is_tracking) ? 1 : 3)) {
return view('tracker', ['trip' => $cachedData->trip, 'showAllCheckins' => ($viewMode === 'all')]);
}
} else {