Don't exclude 7 day stale nodes on Map view when linked in

This commit is contained in:
Jack Kingsman
2026-03-04 12:28:37 -08:00
parent 1ce72ecdf7
commit 9629a35fe1

View File

@@ -94,13 +94,16 @@ function MapBoundsHandler({
}
export function MapView({ contacts, focusedKey }: MapViewProps) {
// Filter to contacts with GPS coordinates, heard within the last 7 days
// Filter to contacts with GPS coordinates, heard within the last 7 days.
// Always include the focused contact so "view on map" links work for older nodes.
const mappableContacts = useMemo(() => {
const sevenDaysAgo = Date.now() / 1000 - 7 * 24 * 60 * 60;
return contacts.filter(
(c) => isValidLocation(c.lat, c.lon) && c.last_seen != null && c.last_seen > sevenDaysAgo
(c) =>
isValidLocation(c.lat, c.lon) &&
(c.public_key === focusedKey || (c.last_seen != null && c.last_seen > sevenDaysAgo))
);
}, [contacts]);
}, [contacts, focusedKey]);
// Find the focused contact by key
const focusedContact = useMemo(() => {