mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
fix: multi email bug
This commit is contained in:
@ -216,6 +216,7 @@ export const AddSignersFormPartial = ({
|
|||||||
// Sync the response recipients back to form state to prevent duplicates
|
// Sync the response recipients back to form state to prevent duplicates
|
||||||
if (response?.recipients) {
|
if (response?.recipients) {
|
||||||
const currentSigners = form.getValues('signers');
|
const currentSigners = form.getValues('signers');
|
||||||
|
|
||||||
const updatedSigners = currentSigners.map((signer) => {
|
const updatedSigners = currentSigners.map((signer) => {
|
||||||
// Find the matching recipient from the response using nativeId
|
// Find the matching recipient from the response using nativeId
|
||||||
const matchingRecipient = response.recipients.find(
|
const matchingRecipient = response.recipients.find(
|
||||||
@ -228,10 +229,9 @@ export const AddSignersFormPartial = ({
|
|||||||
...signer,
|
...signer,
|
||||||
nativeId: matchingRecipient.id,
|
nativeId: matchingRecipient.id,
|
||||||
};
|
};
|
||||||
}
|
} else if (!signer.nativeId) {
|
||||||
|
// For new signers without nativeId, match by email and update with server ID
|
||||||
// For new signers without nativeId, match by email and update with server ID
|
// Bug: Multiple recipients with the same email will be matched incorrectly here.
|
||||||
if (!signer.nativeId) {
|
|
||||||
const newRecipient = response.recipients.find(
|
const newRecipient = response.recipients.find(
|
||||||
(recipient) => recipient.email === signer.email,
|
(recipient) => recipient.email === signer.email,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user