Hard reset posts on time filter switch

This commit is contained in:
Your Name 2025-12-30 20:04:21 -05:00
parent e9195b3f49
commit 7ecf7a9779
1 changed files with 7 additions and 1 deletions

View File

@ -434,6 +434,12 @@ export function usePostsEngine({
const map = mapRef.current; const map = mapRef.current;
replacePoolRef.current = true; replacePoolRef.current = true;
pendingFilterRef.current = `${mainFilter}|${subFilter}|${timeHours}`; pendingFilterRef.current = `${mainFilter}|${subFilter}|${timeHours}`;
allPostsRef.current = [];
setVisiblePosts([]);
syncMarkers([]);
if (map && clustersEnabled && heatmapEnabled) {
updateClusterAreas(map, []);
}
if (map) { if (map) {
map.__swForceFetchAt = Date.now(); map.__swForceFetchAt = Date.now();
setTimeout(() => { setTimeout(() => {
@ -442,7 +448,7 @@ export function usePostsEngine({
} catch {} } catch {}
}, 60); }, 60);
} }
}, [mainFilter, subFilter, timeHours, mapRef]); }, [mainFilter, subFilter, timeHours, mapRef, syncMarkers, clustersEnabled, heatmapEnabled, updateClusterAreas]);
const priorityOpts = { const priorityOpts = {
maxFullCards: 15, maxFullCards: 15,