From 3bd73867d880654f1656c8891f50506a3fb59d87 Mon Sep 17 00:00:00 2001 From: Dalton Adcock Date: Wed, 24 Jan 2024 13:47:13 -0800 Subject: [PATCH] Fixed Custom Events Loading Onto Map (#855) --- apps/antalmanac/src/components/Map/Map.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/antalmanac/src/components/Map/Map.tsx b/apps/antalmanac/src/components/Map/Map.tsx index 8408c1446..8c297f03d 100644 --- a/apps/antalmanac/src/components/Map/Map.tsx +++ b/apps/antalmanac/src/components/Map/Map.tsx @@ -152,18 +152,21 @@ export default function CourseMap() { const [calendarEvents, setCalendarEvents] = useState(AppStore.getCourseEventsInCalendar()); useEffect(() => { - const updateMarkers = () => { + const updateAllMarkers = () => { setMarkers(getCoursesPerBuilding()); + setCustomEventMarkers(getCustomEventPerBuilding()); }; - AppStore.on('addedCoursesChange', updateMarkers); - AppStore.on('currentScheduleIndexChange', updateMarkers); - AppStore.on('colorChange', updateMarkers); + AppStore.on('addedCoursesChange', updateAllMarkers); + AppStore.on('customEventsChange', updateAllMarkers); + AppStore.on('currentScheduleIndexChange', updateAllMarkers); + AppStore.on('colorChange', updateAllMarkers); return () => { - AppStore.removeListener('addedCoursesChange', updateMarkers); - AppStore.removeListener('currentScheduleIndexChange', updateMarkers); - AppStore.removeListener('colorChange', updateMarkers); + AppStore.removeListener('addedCoursesChange', updateAllMarkers); + AppStore.removeListener('customEventsChange', updateAllMarkers); + AppStore.removeListener('currentScheduleIndexChange', updateAllMarkers); + AppStore.removeListener('colorChange', updateAllMarkers); }; }, []);