Added Notifications

This commit is contained in:
2026-05-19 21:45:24 +10:00
parent 3bd2bda84c
commit 3eb3971d79
202 changed files with 90 additions and 15 deletions
@@ -25,7 +25,7 @@ function getCode(airline: Airline): string | null {
function airlineEntriesForLetter(letter: string): AirlineEntry[] {
const flights = props.flightsByLetter[letter] ?? []
const seen = new Map<string, AirlineEntry>()
const seen = new Map<number, AirlineEntry>() // key by airline.id
for (const flight of flights) {
const airline = flight.airline
@@ -35,15 +35,15 @@ function airlineEntriesForLetter(letter: string): AirlineEntry[] {
if (!code?.startsWith(letter)) continue
const year = new Date(flight.departure_date).getFullYear()
const existing = seen.get(code)
const existing = seen.get(airline.id)
if (!existing || year < existing.firstYear) {
seen.set(code, { airline, code, firstYear: year })
seen.set(airline.id, { airline, code, firstYear: year })
}
}
return [...seen.entries()]
.sort(([a], [b]) => a.localeCompare(b))
.map(([, entry]) => entry)
return [...seen.values()]
.sort((a, b) => a.code.localeCompare(b.code))
.map(entry => entry)
}
function isHighlighted({ firstYear }: AirlineEntry): boolean {
@@ -89,7 +89,7 @@ defineExpose({ toBBCode })
<template #items="{ row: letter }">
<div
v-for="entry in airlineEntriesForLetter(letter)"
:key="entry.airline.IATA_code!"
:key="entry.airline.id"
>
<InlineBadge style="align-items:center;gap:0.2em" :variant="isHighlighted(entry) ? 'business' : undefined">
<AirlineLogo :airline="entry.airline" /> {{ entry.code }}
@@ -174,6 +174,9 @@ async function copyBBCode() {
Most letters are possible to visit somewhat organically if you fly enough, but some will be difficult. <b>Q</b> is probably the most difficult letter to obtain -
there's no rules against having a code starting with Q, but due to many aviation terms starting with Q (such as QNH), very few airports use it.
</p>
<p>
Based on our airport database, it is actually possible to obtain every letter except <b>V</b> without leaving China.
</p>
<p>
At time of writing, there are just 2 major airports that have daily scheduled service by major airlines, and 4 airports with any commercial service at all.
Others - such as seaplane ports - might have GA or charter service.