fix: secure setting of onOpenChange on the patient form
This commit is contained in:
parent
8258fac83c
commit
91c84b6a46
@ -395,8 +395,8 @@ export function PatientRegistrationForm({
|
|||||||
|
|
||||||
if (inline && onClose) {
|
if (inline && onClose) {
|
||||||
onClose()
|
onClose()
|
||||||
} else if (onOpenChange) {
|
} else {
|
||||||
onOpenChange(false)
|
onOpenChange?.(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show success message (you might want to use a toast notification)
|
// Show success message (you might want to use a toast notification)
|
||||||
@ -412,8 +412,8 @@ export function PatientRegistrationForm({
|
|||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
if (inline && onClose) {
|
if (inline && onClose) {
|
||||||
onClose()
|
onClose()
|
||||||
} else if (onOpenChange) {
|
} else {
|
||||||
onOpenChange(false)
|
onOpenChange?.(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,10 +464,10 @@ export function PatientRegistrationForm({
|
|||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Label htmlFor="photo" className="cursor-pointer">
|
<Label htmlFor="photo" className="cursor-pointer">
|
||||||
<Button type="button" variant="outline" asChild>
|
<Button type="button" variant="outline" asChild>
|
||||||
<span>
|
<label htmlFor="photo" className="cursor-pointer">
|
||||||
<Upload className="mr-2 h-4 w-4" />
|
<Upload className="mr-2 h-4 w-4" />
|
||||||
Carregar Foto
|
Carregar Foto
|
||||||
</span>
|
</label>
|
||||||
</Button>
|
</Button>
|
||||||
</Label>
|
</Label>
|
||||||
<Input id="photo" type="file" accept="image/*" className="hidden" onChange={handlePhotoUpload} />
|
<Input id="photo" type="file" accept="image/*" className="hidden" onChange={handlePhotoUpload} />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user