fix: lỗi không xuất hiện nút sửa cho điểm bắt đầu và điểm kết thúc

This commit is contained in:
2026-06-17 17:39:53 +07:00
parent bfbbb66747
commit 98e4a4a340
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -1026,8 +1026,13 @@ export const TourDetailPage = ({
setEditingLocation(loc);
setTargetLegId(loc.legId);
setMapCenter([loc.latitude, loc.longitude]);
setIsStartPointAction(false);
setIsEndPointAction(false);
// Kiểm tra xem địa điểm đang sửa có phải là điểm mốc đặc biệt không (dựa trên timestamp 1970)
const isStart = loc.plannedStart && new Date(loc.plannedStart).getTime() === 0;
const isEnd = loc.plannedEnd && new Date(loc.plannedEnd).getTime() === 0;
setIsStartPointAction(!!isStart);
setIsEndPointAction(!!isEnd);
setIsAddLocationOpen(true);
}}
onQuickNote={(locName: string) => handleQuickNote(locName)}