fix: hotfix 동기화 — history/detail candidate_count 안전 처리 #225

병합
htlee hotfix/sync-candidate-count 에서 develop 로 69 commits 를 머지했습니다 2026-04-04 11:05:43 +09:00
Showing only changes of commit 0604887c75 - Show all commits

파일 보기

@ -34,12 +34,19 @@ function formatKST(ts: number): string {
return `${d.getUTCMonth() + 1}/${d.getUTCDate()} ${String(d.getUTCHours()).padStart(2, '0')}:${String(d.getUTCMinutes()).padStart(2, '0')} KST`;
}
// 리플레이 시나리오 시간 범위 (T0 ~ T0+13일)
// 이 범위 밖의 currentTime이면 더미 데이터를 표시하지 않음 (LIVE 모드 대응)
const SCENARIO_START = new Date('2026-03-01T00:00:00Z').getTime();
const SCENARIO_END = new Date('2026-03-14T00:00:00Z').getTime();
export function DamagedShipLayer({ currentTime }: Props) {
const [selectedId, setSelectedId] = useState<string | null>(null);
const isScenarioTime = currentTime >= SCENARIO_START && currentTime <= SCENARIO_END;
const visible = useMemo(
() => damagedShips.filter(s => currentTime >= s.damagedAt),
[currentTime],
() => isScenarioTime ? damagedShips.filter(s => currentTime >= s.damagedAt) : [],
[currentTime, isScenarioTime],
);
const selected = selectedId ? visible.find(s => s.id === selectedId) ?? null : null;