Fix runtime crash: leftover allComments references in MapPage/EventsPage useMemo deps after useCommentCounts rename

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
shakespeare.diy 2026-09-03 21:20:12 +07:00
parent aea66d11e2
commit be95def874
2 changed files with 3 additions and 3 deletions

View file

@ -918,7 +918,7 @@ export default function EventsPage() {
past.sort((a, b) => sortBy === 'recent' ? b.start - a.start : sortFn(a, b)); past.sort((a, b) => sortBy === 'recent' ? b.start - a.start : sortFn(a, b));
return { upcoming, past }; return { upcoming, past };
}, [events, searchQuery, locationQuery, selectedTypes, trustFilter, trustScores, sortBy, dateWindow, now, allComments]); }, [events, searchQuery, locationQuery, selectedTypes, trustFilter, trustScores, sortBy, dateWindow, now, commentCounts]);
// ── Filter tours ────────────────────────────────────────────────────────────── // ── Filter tours ──────────────────────────────────────────────────────────────
const filteredTours = useMemo(() => { const filteredTours = useMemo(() => {
@ -968,7 +968,7 @@ export default function EventsPage() {
}); });
return filtered; return filtered;
}, [tours, tourSearchQuery, tourLocationQuery, tourCategory, tourSkillLevel, tourTrustFilter, trustScores, tourSortBy, allComments]); }, [tours, tourSearchQuery, tourLocationQuery, tourCategory, tourSkillLevel, tourTrustFilter, trustScores, tourSortBy, commentCounts]);
// ── Active filter counts ────────────────────────────────────────────────────── // ── Active filter counts ──────────────────────────────────────────────────────
const activeEventFilterCount = const activeEventFilterCount =

View file

@ -881,7 +881,7 @@ export default function MapPage() {
}); });
return filtered; return filtered;
}, [allLocations, searchQuery, selectedCategories, weatherEnabled, weatherData, weatherFilter, showSpots, showShops, trustFilter, trustScores, sortBy, userLocation, allComments]); }, [allLocations, searchQuery, selectedCategories, weatherEnabled, weatherData, weatherFilter, showSpots, showShops, trustFilter, trustScores, sortBy, userLocation, commentCounts]);
// Spots shown as MAP MARKERS. Hide spots the community has confirmed as // Spots shown as MAP MARKERS. Hide spots the community has confirmed as
// "gone" (demolished) so they don't clutter the map — they still appear // "gone" (demolished) so they don't clutter the map — they still appear