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:
@@ -460,7 +460,7 @@ export const ItineraryTimeline = ({
|
|||||||
Thực tế: {format(parseISO(location.actualStart), 'HH:mm')}
|
Thực tế: {format(parseISO(location.actualStart), 'HH:mm')}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{canEdit && !isStartPoint && !isEndPoint && ( // Only show edit/delete if canEdit
|
{canEdit && ( // Allow editing and deleting of all locations if user has edit permissions
|
||||||
<div className="flex gap-1 mt-2">
|
<div className="flex gap-1 mt-2">
|
||||||
<button onClick={() => onEditLocation?.(location)} className="p-1 text-gray-400 hover:text-blue-600 transition-colors">
|
<button onClick={() => onEditLocation?.(location)} className="p-1 text-gray-400 hover:text-blue-600 transition-colors">
|
||||||
<Edit2 className="w-3.5 h-3.5" />
|
<Edit2 className="w-3.5 h-3.5" />
|
||||||
|
|||||||
@@ -1026,8 +1026,13 @@ export const TourDetailPage = ({
|
|||||||
setEditingLocation(loc);
|
setEditingLocation(loc);
|
||||||
setTargetLegId(loc.legId);
|
setTargetLegId(loc.legId);
|
||||||
setMapCenter([loc.latitude, loc.longitude]);
|
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);
|
setIsAddLocationOpen(true);
|
||||||
}}
|
}}
|
||||||
onQuickNote={(locName: string) => handleQuickNote(locName)}
|
onQuickNote={(locName: string) => handleQuickNote(locName)}
|
||||||
|
|||||||
Reference in New Issue
Block a user