diff --git a/src/components/Map/usePostsEngine.js b/src/components/Map/usePostsEngine.js index 907314e..d5f82a4 100644 --- a/src/components/Map/usePostsEngine.js +++ b/src/components/Map/usePostsEngine.js @@ -434,6 +434,12 @@ export function usePostsEngine({ const map = mapRef.current; replacePoolRef.current = true; pendingFilterRef.current = `${mainFilter}|${subFilter}|${timeHours}`; + allPostsRef.current = []; + setVisiblePosts([]); + syncMarkers([]); + if (map && clustersEnabled && heatmapEnabled) { + updateClusterAreas(map, []); + } if (map) { map.__swForceFetchAt = Date.now(); setTimeout(() => { @@ -442,7 +448,7 @@ export function usePostsEngine({ } catch {} }, 60); } - }, [mainFilter, subFilter, timeHours, mapRef]); + }, [mainFilter, subFilter, timeHours, mapRef, syncMarkers, clustersEnabled, heatmapEnabled, updateClusterAreas]); const priorityOpts = { maxFullCards: 15,