fix: hotfix 동기화 — history/detail candidate_count 안전 처리 #225
@ -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;
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user