This commit is contained in:
skkim committed 2026-11-24 11:28:29 +09:00
commit ceda60bde7
89 files changed
+70 -9214

No files matched your search

+2 -8
View File
@@ -223,15 +223,9 @@ function Hero({ hero, post, today, ranked, all, feedLoad, todayLoad }: HeroProps
}, [tmr, tmrKind, setPreview])
const slots = (tmr ? tomorrowQ.data?.slots : today?.slots) ?? []
const slotsLoad = tmr ? loadOf(tomorrowQ) : todayLoad
// 그 시각 칸, 비어 있으면(지난 새벽 칸 등) 그 뒤 첫 예보 칸
// 지금은 가장 가까운 3시간 칸(17시면 18시 칸). 시간대는 그 시각 칸, 비어 있으면(지난 새벽 칸 등) 그 뒤 첫 예보 칸
// 지금은 지금이 든 3시간 칸(17시면 15시 칸. 서버가 그 칸에 지금 시각 예보를 넣어 준다). 시간대는 그 시각 칸, 비어 있으면(지난 새벽 칸 등) 그 뒤 첫 예보 칸
const slotOf = (k: TimeKind | 'now') => {
if (k === 'now') {
const known = slots.filter((x) => x.temp_c != null)
const at = t.h + t.mi / 60
return known.length ? known.reduce((a, b) => (Math.abs(kst(b.at).h - at) < Math.abs(kst(a.at).h - at) ? b : a)) : undefined
}
const h = PREVIEW[k].hour
const h = k === 'now' ? t.h : PREVIEW[k].hour
const s = slots.length ? slotAt(slots, h) : undefined
return s?.temp_c != null ? s : (slots.find((x) => kst(x.at).h > h && x.temp_c != null) ?? s)
}