fix(flight-live): sort attribution sources with an explicit compare

This commit is contained in:
Maurice
2026-11-14 10:18:03 +01:00
parent 5f49c87f4a
commit e1e8c4c63d
@@ -138,7 +138,9 @@ export class FlightLiveService {
/** The credit line for what the answer shows: the sources its legs were read from, else the first source. */
private attributionFor(flights: readonly FlightLiveLeg[]): string {
const sources = [...new Set(flights.flatMap((f) => (f.source ? [f.source] : [])))].sort();
const sources = [...new Set(flights.flatMap((f) => (f.source ? [f.source] : [])))].sort((a, b) =>
a.localeCompare(b),
);
if (sources.length === 0) return this.feeds.attribution();
return sources.map((source) => FEED_ATTRIBUTION[source]).join('; ');
}