Show fallback posts when bounds empty
This commit is contained in:
parent
68cb21fc23
commit
d7bf3e22cb
|
|
@ -537,6 +537,9 @@ export function usePostsEngine({
|
|||
if (vBounded.length === 0 && viewParams?.center && viewParams?.radiusKm) {
|
||||
vBounded = filterByRadius(vAll, viewParams.center, viewParams.radiusKm * 1.2);
|
||||
}
|
||||
if (vBounded.length === 0) {
|
||||
vBounded = vAll;
|
||||
}
|
||||
let v = vBounded;
|
||||
if (v.length > MAX_VISIBLE_POSTS) {
|
||||
const center = map?.getCenter?.();
|
||||
|
|
@ -723,15 +726,12 @@ export function usePostsEngine({
|
|||
}
|
||||
}
|
||||
|
||||
const delay = initialLoadRef.current ? 0 : 2400;
|
||||
initialLoadRef.current = false;
|
||||
if (moveDebounceRef.current) {
|
||||
clearTimeout(moveDebounceRef.current);
|
||||
moveDebounceRef.current = null;
|
||||
}
|
||||
moveDebounceRef.current = setTimeout(() => {
|
||||
if (!cancelled) load();
|
||||
}, delay);
|
||||
initialLoadRef.current = false;
|
||||
load();
|
||||
return () => {
|
||||
cancelled = true;
|
||||
if (moveDebounceRef.current) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue