mirror of
https://github.com/documenso/documenso.git
synced 2025-11-19 03:01:59 +10:00
fix: cleanup
This commit is contained in:
@ -238,25 +238,17 @@ export const EnvelopeEditorRecipientForm = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onAddSigner = () => {
|
const onAddSigner = () => {
|
||||||
let newRecipient = {
|
const placeholderRecipientCount = signers.length > 1 ? signers.length + 1 : 2;
|
||||||
|
|
||||||
|
appendSigner({
|
||||||
formId: nanoid(12),
|
formId: nanoid(12),
|
||||||
name: '',
|
name: '',
|
||||||
email: '',
|
email: '',
|
||||||
role: RecipientRole.SIGNER,
|
role: RecipientRole.SIGNER,
|
||||||
actionAuth: [],
|
actionAuth: [],
|
||||||
signingOrder: signers.length > 0 ? (signers[signers.length - 1]?.signingOrder ?? 0) + 1 : 1,
|
signingOrder: signers.length > 0 ? (signers[signers.length - 1]?.signingOrder ?? 0) + 1 : 1,
|
||||||
};
|
...(isTemplate ? generateRecipientPlaceholder(placeholderRecipientCount) : {}),
|
||||||
|
});
|
||||||
if (isTemplate) {
|
|
||||||
const placeholderRecipientCount = signers.length > 1 ? signers.length + 1 : 2;
|
|
||||||
|
|
||||||
newRecipient = {
|
|
||||||
...newRecipient,
|
|
||||||
...generateRecipientPlaceholder(placeholderRecipientCount),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
appendSigner(newRecipient);
|
|
||||||
|
|
||||||
void form.trigger('signers');
|
void form.trigger('signers');
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user