Skip to content

Commit

Permalink
Merge branch 'main' into tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
MinhxNguyen7 committed Jan 31, 2024
2 parents bdfcaba + 210298d commit 0f526fb
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions apps/antalmanac/src/components/Map/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,34 @@ export default function CourseMap() {
};
}, []);

useEffect(() => {
const updateCustomEventMarkers = () => {
setCustomEventMarkers(getCustomEventPerBuilding());
};

AppStore.on('customEventsChange', updateCustomEventMarkers);
AppStore.on('currentScheduleIndexChange', updateCustomEventMarkers);

return () => {
AppStore.removeListener('customEventsChange', updateCustomEventMarkers);
AppStore.removeListener('currentScheduleIndexChange', updateCustomEventMarkers);
};
}, []);

useEffect(() => {
const updateCustomEventMarkers = () => {
setCustomEventMarkers(getCustomEventPerBuilding());
};

AppStore.on('customEventsChange', updateCustomEventMarkers);
AppStore.on('currentScheduleIndexChange', updateCustomEventMarkers);

return () => {
AppStore.removeListener('customEventsChange', updateCustomEventMarkers);
AppStore.removeListener('currentScheduleIndexChange', updateCustomEventMarkers);
};
}, []);

useEffect(() => {
const locationID = Number(searchParams.get('location') ?? 0);
const building = locationID in buildingCatalogue ? buildingCatalogue[locationID] : undefined;
Expand Down

0 comments on commit 0f526fb

Please sign in to comment.