fix: lỗi bong bóng Tour vẫn xuất hiện và điểm kết thúc
This commit is contained in:
@@ -208,6 +208,7 @@ export const TourDetailPage = ({
|
||||
const [isAddMemberOpen, setIsAddMemberOpen] = useState(false);
|
||||
const [isAddPhotoOpen, setIsAddPhotoOpen] = useState(false);
|
||||
const [isStartPointAction, setIsStartPointAction] = useState(false);
|
||||
const [isEndPointAction, setIsEndPointAction] = useState(false);
|
||||
const [targetLegId, setTargetLegId] = useState<string | null>(null);
|
||||
const [editingLocation, setEditingLocation] = useState<any>(null);
|
||||
const [selectedMember, setSelectedMember] = useState<any>(null);
|
||||
@@ -1015,16 +1016,18 @@ export const TourDetailPage = ({
|
||||
</div>
|
||||
|
||||
{viewMode === 'timeline' ? (
|
||||
<ItineraryTimeline onAddLocation={(legId, isStart) => {
|
||||
<ItineraryTimeline onAddLocation={(legId, isStart, isEnd) => {
|
||||
setTargetLegId(legId);
|
||||
setEditingLocation(null);
|
||||
setIsStartPointAction(!!isStart);
|
||||
setIsEndPointAction(!!isEnd);
|
||||
setIsAddLocationOpen(true);
|
||||
}} onEditLocation={(loc) => {
|
||||
setEditingLocation(loc);
|
||||
setTargetLegId(loc.legId);
|
||||
setMapCenter([loc.latitude, loc.longitude]);
|
||||
setIsStartPointAction(false);
|
||||
setIsEndPointAction(false);
|
||||
setIsAddLocationOpen(true);
|
||||
}}
|
||||
onQuickNote={(locName: string) => handleQuickNote(locName)}
|
||||
@@ -1509,6 +1512,7 @@ export const TourDetailPage = ({
|
||||
setTargetLegId(null); // Reset khi nhấn nút floating tổng quát
|
||||
setEditingLocation(null);
|
||||
setIsStartPointAction(false);
|
||||
setIsEndPointAction(false);
|
||||
if (activeTab === 'plan') setIsAddLocationOpen(true);
|
||||
if (activeTab === 'photo' && canUploadPhoto) setIsAddPhotoOpen(true);
|
||||
}}
|
||||
@@ -1540,6 +1544,7 @@ export const TourDetailPage = ({
|
||||
onClose={() => setIsAddLocationOpen(false)}
|
||||
initialLegId={targetLegId || undefined}
|
||||
isStartPoint={isStartPointAction}
|
||||
isEndPoint={isEndPointAction}
|
||||
editingLocation={editingLocation}
|
||||
tourId={currentTour.id}
|
||||
isPublicView={isPublicView} // Pass isPublicView
|
||||
|
||||
Reference in New Issue
Block a user