diff --git a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/ManagementActivitiesListContainer.tsx b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/ManagementActivitiesListContainer.tsx index c76fe4bb1f..b1ad408dbf 100644 --- a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/ManagementActivitiesListContainer.tsx +++ b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/ManagementActivitiesListContainer.tsx @@ -1,6 +1,7 @@ -import { useCallback, useEffect, useState } from 'react'; +import { useCallback, useContext, useEffect, useState } from 'react'; import { useHistory } from 'react-router-dom'; +import { SideBarContext } from '@/features/mapSideBar/context/sidebarContext'; import { usePropertyActivityRepository } from '@/hooks/repositories/usePropertyActivityRepository'; import { getDeleteModalProps, useModalContext } from '@/hooks/useModalContext'; import useIsMounted from '@/hooks/util/useIsMounted'; @@ -20,6 +21,7 @@ const PropertyManagementActivitiesListContainer: React.FunctionComponent< const isMounted = useIsMounted(); const { setModalContent, setDisplayModal } = useModalContext(); const [propertyActivities, setPropertyActivities] = useState([]); + const { staleLastUpdatedBy } = useContext(SideBarContext); const { getActivities: { execute: getActivities, loading }, @@ -45,7 +47,8 @@ const PropertyManagementActivitiesListContainer: React.FunctionComponent< useEffect(() => { fetchPropertyActivities(); - }, [fetchPropertyActivities]); + }, [fetchPropertyActivities, staleLastUpdatedBy]); + //TODO: remove staleLastUpdatedBy when side bar context is refactored. const onCreate = () => { history.push(`/mapview/sidebar/property/${propertyId}/activity/new`);