From be95def8743a7ec86689c7d705b44c96fa3ee039 Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Thu, 3 Sep 2026 21:20:12 +0700 Subject: [PATCH] Fix runtime crash: leftover allComments references in MapPage/EventsPage useMemo deps after useCommentCounts rename Co-authored-by: shakespeare.diy --- src/pages/EventsPage.tsx | 4 ++-- src/pages/MapPage.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/EventsPage.tsx b/src/pages/EventsPage.tsx index bab7ee5..44420da 100644 --- a/src/pages/EventsPage.tsx +++ b/src/pages/EventsPage.tsx @@ -918,7 +918,7 @@ export default function EventsPage() { past.sort((a, b) => sortBy === 'recent' ? b.start - a.start : sortFn(a, b)); 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 ────────────────────────────────────────────────────────────── const filteredTours = useMemo(() => { @@ -968,7 +968,7 @@ export default function EventsPage() { }); return filtered; - }, [tours, tourSearchQuery, tourLocationQuery, tourCategory, tourSkillLevel, tourTrustFilter, trustScores, tourSortBy, allComments]); + }, [tours, tourSearchQuery, tourLocationQuery, tourCategory, tourSkillLevel, tourTrustFilter, trustScores, tourSortBy, commentCounts]); // ── Active filter counts ────────────────────────────────────────────────────── const activeEventFilterCount = diff --git a/src/pages/MapPage.tsx b/src/pages/MapPage.tsx index c8696c8..664e55e 100644 --- a/src/pages/MapPage.tsx +++ b/src/pages/MapPage.tsx @@ -881,7 +881,7 @@ export default function MapPage() { }); 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 // "gone" (demolished) so they don't clutter the map — they still appear