Force flight to visible before day checks

This commit is contained in:
Nabeel Shahzad
2021-01-21 10:57:51 -05:00
parent 2e0f0b00ef
commit 0578f98b58
+3 -6
View File
@@ -42,6 +42,9 @@ class SetActiveFlights extends Listener
continue; continue;
} }
// Set to visible by default
$flight->visible = true;
// dates aren't set, so just save if there were any changes above // dates aren't set, so just save if there were any changes above
// and move onto the next one // and move onto the next one
if ($flight->start_date === null || $flight->end_date === null) { if ($flight->start_date === null || $flight->end_date === null) {
@@ -56,9 +59,6 @@ class SetActiveFlights extends Listener
.Days::in($flight->days, Days::$isoDayMap[(int) date('N')])); .Days::in($flight->days, Days::$isoDayMap[(int) date('N')]));
} }
} }
} else {
Log::info('Toggling flight '.$flight->ident.' to visible');
$flight->visible = true;
} }
$flight->save(); $flight->save();
@@ -82,9 +82,6 @@ class SetActiveFlights extends Listener
.Days::in($flight->days, Days::$isoDayMap[(int) date('N')])); .Days::in($flight->days, Days::$isoDayMap[(int) date('N')]));
} }
} }
} else {
Log::info('Toggling flight '.$flight->ident.' to visible');
$flight->visible = true;
} }
} else { } else {
$flight->visible = false; $flight->visible = false;