Skip to content

Commit

Permalink
psp-7096 hook list view into stale last update event. (#3560)
Browse files Browse the repository at this point in the history
* hook list view into stale last update event.

* add todo
  • Loading branch information
devinleighsmith authored Nov 6, 2023
1 parent 53fa762 commit 02342b2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -20,6 +21,7 @@ const PropertyManagementActivitiesListContainer: React.FunctionComponent<
const isMounted = useIsMounted();
const { setModalContent, setDisplayModal } = useModalContext();
const [propertyActivities, setPropertyActivities] = useState<PropertyActivityRow[]>([]);
const { staleLastUpdatedBy } = useContext(SideBarContext);

const {
getActivities: { execute: getActivities, loading },
Expand All @@ -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`);
Expand Down

0 comments on commit 02342b2

Please sign in to comment.