fix: sửa tính năng hiển thị quãng đường tại điểm đến kế tiếp
This commit is contained in:
@@ -479,6 +479,21 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos
|
||||
isOpen={isCreateModalOpen}
|
||||
onClose={() => setIsCreateModalOpen(false)}
|
||||
onSuccess={(tour) => {
|
||||
// Tự động tạo ghi chú mới cho hành trình vừa tạo
|
||||
const savedNotes = localStorage.getItem('my_journey_notes');
|
||||
let notes = [];
|
||||
try {
|
||||
notes = savedNotes ? JSON.parse(savedNotes) : [];
|
||||
} catch (e) { notes = []; }
|
||||
|
||||
const newTourNote = {
|
||||
id: Date.now().toString(),
|
||||
title: `Ghi chú của hành trình: ${tour.title}`,
|
||||
content: `<p>Bắt đầu lập kế hoạch cho chuyến đi <strong>${tour.title}</strong> của bạn tại đây...</p>`,
|
||||
createdAt: new Date().toISOString()
|
||||
};
|
||||
localStorage.setItem('my_journey_notes', JSON.stringify([newTourNote, ...notes]));
|
||||
|
||||
fetchTour(tour.id);
|
||||
onViewTour(tour.id);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user