fix: align hong kong compact hko stat

This commit is contained in:
2569718930@qq.com
2026-06-06 17:01:39 +08:00
parent 2766b6463c
commit 89f77b8db4
4 changed files with 103 additions and 3 deletions
@@ -845,9 +845,14 @@ function getObservationDisplayMetrics(
null;
}
const currentMetarTemp =
latestSettlement ??
latestMetar ??
airportCurrentTemp ??
null;
const observedHighMetar = airportHigh ?? highSettlement ?? highMetar ?? rowMetarHigh ?? null;
return { currentRunwayTemp, observedHighMetar, observedHighRunway };
return { currentMetarTemp, currentRunwayTemp, observedHighMetar, observedHighRunway };
}
function selectDisplayRunwayTemp(
@@ -859,6 +864,23 @@ function selectDisplayRunwayTemp(
return liveTemp;
}
function selectCompactSecondaryTemp({
isHKO,
isShenzhen,
displayMetarTemp,
observedHighMetar,
}: {
isHKO: boolean;
isShenzhen: boolean;
displayMetarTemp: number | null;
observedHighMetar: number | null;
}) {
if (isHKO && !isShenzhen && displayMetarTemp !== null) {
return displayMetarTemp;
}
return observedHighMetar;
}
function isSettlementRunway(row: ScanOpportunityRow | null, rwy: string) {
const cityKey = normalizeCityKey(row?.city);
const settlementPairs = SETTLEMENT_RUNWAY_PAIRS[cityKey] || [];
@@ -2485,6 +2507,7 @@ export {
normalizeCityKey,
prefersHighFrequencyRunwayResolution,
readSessionCache,
selectCompactSecondaryTemp,
selectDisplayRunwayTemp,
seedHourlyForecastFromRow,
seriesStats,