Merge pull request 'fix: LIVE 모드 더미 피격선박 제거' (#65) from develop into main
All checks were successful
Deploy KCG / deploy (push) Successful in 1m29s
All checks were successful
Deploy KCG / deploy (push) Successful in 1m29s
This commit is contained in:
커밋
0604887c75
@ -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`;
|
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) {
|
export function DamagedShipLayer({ currentTime }: Props) {
|
||||||
const [selectedId, setSelectedId] = useState<string | null>(null);
|
const [selectedId, setSelectedId] = useState<string | null>(null);
|
||||||
|
|
||||||
|
const isScenarioTime = currentTime >= SCENARIO_START && currentTime <= SCENARIO_END;
|
||||||
|
|
||||||
const visible = useMemo(
|
const visible = useMemo(
|
||||||
() => damagedShips.filter(s => currentTime >= s.damagedAt),
|
() => isScenarioTime ? damagedShips.filter(s => currentTime >= s.damagedAt) : [],
|
||||||
[currentTime],
|
[currentTime, isScenarioTime],
|
||||||
);
|
);
|
||||||
|
|
||||||
const selected = selectedId ? visible.find(s => s.id === selectedId) ?? null : null;
|
const selected = selectedId ? visible.find(s => s.id === selectedId) ?? null : null;
|
||||||
|
|||||||
불러오는 중...
Reference in New Issue
Block a user