fix: map pins update immediately when category filter is cleared

This commit is contained in:
Maurice
2026-03-29 15:27:56 +02:00
parent f4ee7b868d
commit 808b7f7a72

View File

@@ -118,7 +118,7 @@ export default function TripPlannerPage(): React.ReactElement | null {
const [mapCategoryFilter, setMapCategoryFilter] = useState<string>('')
const mapPlaces = useCallback(() => {
const mapPlaces = useMemo(() => {
return places.filter(p => {
if (!p.lat || !p.lng) return false
if (mapCategoryFilter && String(p.category_id) !== String(mapCategoryFilter)) return false
@@ -376,7 +376,7 @@ export default function TripPlannerPage(): React.ReactElement | null {
{activeTab === 'plan' && (
<div style={{ position: 'absolute', inset: 0 }}>
<MapView
places={mapPlaces()}
places={mapPlaces}
dayPlaces={dayPlaces}
route={route}
routeSegments={routeSegments}