Pridani letiste pro mezipristani

This commit is contained in:
Michal Kváček
2023-10-07 21:37:16 +02:00
parent 36b0178b97
commit 901c652641
7 changed files with 89 additions and 21 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ export const flightName = (flight) => {
if (flight.name !== '') {
return `${flight.name} (${date})`
} else {
const track = flight.track ? flight.track.map(t => t.pointOfInterest.name) : [];
const track = flight.track ? flight.track.map(t => t.pointOfInterest?.name || t.airport?.icaoCode) : [];
const trackStr = track.length > 0 ? ` - ${track.join(" - ")} - ` : ' - ';
return `${flight.takeoffAirport.icaoCode} ${trackStr} ${flight.landingAirport.icaoCode} (${date})`;