Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psp-7096 hook list view into stale last update event. #3560

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading