diff --git a/src/stores/shipStore.js b/src/stores/shipStore.js index 727c4a8a..c3ff18f4 100644 --- a/src/stores/shipStore.js +++ b/src/stores/shipStore.js @@ -336,6 +336,14 @@ const useShipStore = create(subscribeWithSelector((set, get) => ({ return; } + // 타임스탬프 비교: 기존 데이터보다 오래된 메시지는 무시 + // 참조: mda-react-front/src/shared/model/deckStore.ts - mergeFeatures (line 163) + const newTimestamp = parseReceivedTime(ship.receivedTime); + const currentFeature = features.get(featureId); + if (currentFeature && newTimestamp < currentFeature.receivedTimestamp) { + return; // 이전 시간대 데이터 → 무시 + } + const hasActive = isAnyEquipmentActive(ship); // 규칙 1: LOST=0(영해 내) + 모든 장비 비활성 → 저장하지 않음 (완전 삭제) @@ -355,7 +363,7 @@ const useShipStore = create(subscribeWithSelector((set, get) => ({ } } - features.set(featureId, { ...ship, receivedTimestamp: parseReceivedTime(ship.receivedTime) }); + features.set(featureId, { ...ship, receivedTimestamp: newTimestamp }); }); // 버전 카운터 증가