diff --git a/source/frontend/src/components/maps/hooks/useMapSearch.tsx b/source/frontend/src/components/maps/hooks/useMapSearch.tsx index 0dbe42b53d..8da5961f3d 100644 --- a/source/frontend/src/components/maps/hooks/useMapSearch.tsx +++ b/source/frontend/src/components/maps/hooks/useMapSearch.tsx @@ -59,9 +59,11 @@ export const useMapSearch = () => { task3 = parcelsService.findByPid(filter?.PID); } - const pidPinInventoryData = await task1; - const pinNonInventoryData = await task2; - const pidNonInventoryData = await task3; + const [pidPinInventoryData, pinNonInventoryData, pidNonInventoryData] = await Promise.all([ + task1, + task2, + task3, + ]); if (pidPinInventoryData?.features === undefined) { setModalContent({ diff --git a/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseContainer.tsx b/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseContainer.tsx index 4c16ea7387..372bf8cc6e 100644 --- a/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseContainer.tsx +++ b/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseContainer.tsx @@ -1,3 +1,4 @@ +import { useMapSearch } from 'components/maps/hooks/useMapSearch'; import LoadingBackdrop from 'components/maps/leaflet/LoadingBackdrop/LoadingBackdrop'; import { LeaseStateContext } from 'features/leases/context/LeaseContext'; import { useLeaseDetail } from 'features/leases/hooks/useLeaseDetail'; @@ -30,6 +31,7 @@ export const UpdateLeaseContainer: React.FunctionComponent< const withUserOverride = useApiUserOverride< (userOverrideCodes: UserOverrideCode[]) => Promise >('Failed to update Lease File'); + const { search } = useMapSearch(); const leaseId = lease?.id; //TODO: For now we make a duplicate request here for the lease in the newer format. In the future all lease pages will use the new format so this will no longer be necessary. @@ -58,6 +60,7 @@ export const UpdateLeaseContainer: React.FunctionComponent< if (!!updatedLease?.id) { formikRef?.current?.resetForm({ values: formikRef?.current?.values }); await refresh(); + await search(); onEdit(false); } };