From 4f1ad246e4492eb8dea29feb0ad22f2889daf39f Mon Sep 17 00:00:00 2001 From: Khavin Shankar Date: Sat, 7 Jan 2023 17:13:15 +0530 Subject: [PATCH] fix (ManagePatients): fixed patient loading issue while directly using the link --- src/Components/Patient/ManagePatients.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Components/Patient/ManagePatients.tsx b/src/Components/Patient/ManagePatients.tsx index 1a909eca113..7aae1d5705f 100644 --- a/src/Components/Patient/ManagePatients.tsx +++ b/src/Components/Patient/ManagePatients.tsx @@ -35,7 +35,6 @@ import ButtonV2 from "../Common/components/ButtonV2"; import { ExportMenu } from "../Common/Export"; import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField"; import { FieldChangeEvent } from "../Form/FormFields/Utils"; -import useIsInitialRender from "../../Common/hooks/useIsInitialRender"; const Loading = loadable(() => import("../Common/Loading")); const PageTitle = loadable(() => import("../Common/PageTitle")); @@ -99,7 +98,6 @@ export const PatientManager = () => { const [emergency_phone_number, setEmergencyPhoneNumber] = useState(""); const [emergencyPhoneNumberError, setEmergencyPhoneNumberError] = useState(""); - const isInitialRender = useIsInitialRender(); useEffect(() => { if (phone_number.length === 15) { @@ -241,7 +239,7 @@ export const PatientManager = () => { }; useEffect(() => { - if (isInitialRender) return; + if (params.page === 1) return; setIsLoading(true); dispatch(getAllPatient(params, "listPatients"))