From 7ecf7a977960a2953ee02772650126dc3086ce77 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 30 Dec 2025 20:04:21 -0500 Subject: [PATCH] Hard reset posts on time filter switch --- src/components/Map/usePostsEngine.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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,