diff --git a/src/Components/Facility/DuplicatePatientDialog.tsx b/src/Components/Facility/DuplicatePatientDialog.tsx index 7450d9fd8f1..b948ad91fa3 100644 --- a/src/Components/Facility/DuplicatePatientDialog.tsx +++ b/src/Components/Facility/DuplicatePatientDialog.tsx @@ -7,13 +7,12 @@ interface Props { patientList: Array; handleOk: (action: string) => void; handleCancel: () => void; - isNew: boolean; } const tdClass = "border border-secondary-400 p-2 text-left"; const DuplicatePatientDialog = (props: Props) => { - const { patientList, handleOk, handleCancel, isNew } = props; + const { patientList, handleOk, handleCancel } = props; const [action, setAction] = useState(""); return ( @@ -118,7 +117,7 @@ const DuplicatePatientDialog = (props: Props) => { { }); const [careExtId, setCareExtId] = useState(""); const [formField, setFormField] = useState(); + const [resetNum, setResetNum] = useState(false); const [isDistrictLoading, setIsDistrictLoading] = useState(false); const [isLocalbodyLoading, setIsLocalbodyLoading] = useState(false); const [isWardLoading, setIsWardLoading] = useState(false); @@ -1003,21 +1004,29 @@ export const PatientRegister = (props: PatientRegisterProps) => { { + handleDialogClose("close"); + setResetNum(true); + }} /> )} {statusDialog.transfer && ( handleDialogClose("back")} + onClose={() => { + setResetNum(true); + handleDialogClose("close"); + }} title="Patient Transfer Form" className="max-w-md md:min-w-[600px]" > handleDialogClose("close")} - handleCancel={() => handleDialogClose("back")} + handleCancel={() => { + setResetNum(true); + handleDialogClose("close"); + }} facilityId={facilityId} /> @@ -1134,6 +1143,13 @@ export const PatientRegister = (props: PatientRegisterProps) => { > {(field) => { if (!formField) setFormField(field); + if (resetNum) { + field("phone_number").onChange({ + name: "phone_number", + value: "+91", + }); + setResetNum(false); + } return ( <>