Hard reset posts on time filter switch
This commit is contained in:
parent
e9195b3f49
commit
7ecf7a9779
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue