mirror of
https://github.com/documenso/documenso
synced 2026-04-21 13:27:18 +00:00
fix: hide name/email in embed signing when provided via prop (#2600)
## Description When signing via embed, recipient name and email provided through the embed context were ignored if the DB recipient record had empty values. This fix adds: - the signing context's fullName and email as fallbacks in the recipient payload - keeps the form in sync with values instead of defaultValues - ensures the override payload is sent even when the form is hidden
This commit is contained in:
parent
83fbc70a1c
commit
32c54e1245
2 changed files with 7 additions and 1 deletions
|
|
@ -117,7 +117,7 @@ export const DocumentSigningCompleteDialog = ({
|
|||
|
||||
const recipientForm = useForm<TDirectRecipientFormSchema>({
|
||||
resolver: zodResolver(ZDirectRecipientFormSchema),
|
||||
defaultValues: {
|
||||
values: {
|
||||
name: recipientPayload?.name ?? '',
|
||||
email: recipientPayload?.email ?? '',
|
||||
},
|
||||
|
|
@ -157,6 +157,10 @@ export const DocumentSigningCompleteDialog = ({
|
|||
}
|
||||
|
||||
recipientOverridePayload = recipientForm.getValues();
|
||||
} else if (recipientPayload && recipientPayload.email && !recipient.email) {
|
||||
// Form is hidden because we have an email (e.g. from embed context),
|
||||
// but the DB recipient doesn't have one yet — send the override.
|
||||
recipientOverridePayload = recipientPayload;
|
||||
}
|
||||
|
||||
// Check if 2FA is required
|
||||
|
|
|
|||
|
|
@ -221,10 +221,12 @@ export const EnvelopeSignerCompleteDialog = () => {
|
|||
return {
|
||||
name:
|
||||
recipient.name ||
|
||||
fullName ||
|
||||
recipient.fields.find((field) => field.type === FieldType.NAME)?.customText ||
|
||||
'',
|
||||
email:
|
||||
recipient.email ||
|
||||
email ||
|
||||
recipient.fields.find((field) => field.type === FieldType.EMAIL)?.customText ||
|
||||
'',
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue