From 91c84b6a46778f34db1e31bb261b830394da045d Mon Sep 17 00:00:00 2001 From: M-Gabrielly Date: Thu, 4 Sep 2025 15:46:55 -0300 Subject: [PATCH] fix: secure setting of onOpenChange on the patient form --- .../components/forms/patient-registration-form.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/susconecta/components/forms/patient-registration-form.tsx b/susconecta/components/forms/patient-registration-form.tsx index ceff417..95ac4c6 100644 --- a/susconecta/components/forms/patient-registration-form.tsx +++ b/susconecta/components/forms/patient-registration-form.tsx @@ -395,8 +395,8 @@ export function PatientRegistrationForm({ if (inline && onClose) { onClose() - } else if (onOpenChange) { - onOpenChange(false) + } else { + onOpenChange?.(false) } // Show success message (you might want to use a toast notification) @@ -412,8 +412,8 @@ export function PatientRegistrationForm({ const handleCancel = () => { if (inline && onClose) { onClose() - } else if (onOpenChange) { - onOpenChange(false) + } else { + onOpenChange?.(false) } } @@ -464,10 +464,10 @@ export function PatientRegistrationForm({