Fix caching parenthesisation

This commit is contained in:
Ben Goldsworthy 2022-10-23 19:16:28 +00:00
parent 74b7df62b7
commit 40134331b5

View file

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