Reset cluster focus on time change
This commit is contained in:
parent
ae61e19e09
commit
0647dc823b
|
|
@ -59,6 +59,11 @@ export default function MapView({
|
|||
} catch {}
|
||||
}, [timeHours]);
|
||||
|
||||
useEffect(() => {
|
||||
if (clusterFocus) setClusterFocus(null);
|
||||
if (mainNewsOnly) setMainNewsOnly(false);
|
||||
}, [timeHours]);
|
||||
|
||||
const stageRef = useRef(null);
|
||||
const [showSubcats, setShowSubcats] = useState(true);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { fetchPosts, fetchSmartFeed, fetchUnifiedSearch } from "../../api/client";
|
||||
import { categoryCode, matchesSubFilter, matchesTimeFilter, effectivePostTime } from "./mapFilter";
|
||||
import { categoryCode, matchesSubFilter } from "./mapFilter";
|
||||
import { getCoords, getViewFromMap, haversineKm } from "./mapGeo";
|
||||
import { createMarkerForPost, createSimpleMarkerForPost } from "./markerManager";
|
||||
import { getTemplateKeyForPost } from "./templateSpecs";
|
||||
|
|
@ -867,7 +867,6 @@ export function usePostsEngine({
|
|||
if (pc !== catCode) return false;
|
||||
}
|
||||
if (!matchesSubFilter(p, subFilter)) return false;
|
||||
if (!matchesTimeFilter(effectivePostTime(p), tf)) return false;
|
||||
if (!searchResultsRef.current && !matchesSearch(p, searchQuery)) return false;
|
||||
return true;
|
||||
});
|
||||
|
|
@ -1283,7 +1282,6 @@ export function usePostsEngine({
|
|||
if (pc !== catCode) return;
|
||||
}
|
||||
if (!matchesSubFilter(p, subFilter)) return;
|
||||
if (!matchesTimeFilter(effectivePostTime(p), timeHours)) return;
|
||||
if (!matchesSearch(p, searchQuery)) return;
|
||||
|
||||
if (clusterModeRef.current) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue