From a75e71700f85cda59a1a98357860e3fcde126233 Mon Sep 17 00:00:00 2001 From: David Nguyen Date: Tue, 18 Nov 2025 13:12:09 +1100 Subject: [PATCH] fix: cleanup --- .../envelope-editor-recipient-form.tsx | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/apps/remix/app/components/general/envelope-editor/envelope-editor-recipient-form.tsx b/apps/remix/app/components/general/envelope-editor/envelope-editor-recipient-form.tsx index 67bad9d6c..0b399e236 100644 --- a/apps/remix/app/components/general/envelope-editor/envelope-editor-recipient-form.tsx +++ b/apps/remix/app/components/general/envelope-editor/envelope-editor-recipient-form.tsx @@ -238,25 +238,17 @@ export const EnvelopeEditorRecipientForm = () => { }; const onAddSigner = () => { - let newRecipient = { + const placeholderRecipientCount = signers.length > 1 ? signers.length + 1 : 2; + + appendSigner({ formId: nanoid(12), name: '', email: '', role: RecipientRole.SIGNER, actionAuth: [], signingOrder: signers.length > 0 ? (signers[signers.length - 1]?.signingOrder ?? 0) + 1 : 1, - }; - - if (isTemplate) { - const placeholderRecipientCount = signers.length > 1 ? signers.length + 1 : 2; - - newRecipient = { - ...newRecipient, - ...generateRecipientPlaceholder(placeholderRecipientCount), - }; - } - - appendSigner(newRecipient); + ...(isTemplate ? generateRecipientPlaceholder(placeholderRecipientCount) : {}), + }); void form.trigger('signers'); };