diff --git a/packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx b/packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx index df7eb6193..642e76031 100644 --- a/packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx +++ b/packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx @@ -49,6 +49,8 @@ export const AddTemplatePlaceholderRecipientsFormPartial = ({ recipients.length > 1 ? recipients.length + 1 : 2, ); + const userIsSelfRecipient = () => signers.some((signer) => signer.email === user?.email); + const { currentStep, totalSteps, previousStep } = useStep(); const { @@ -115,9 +117,11 @@ export const AddTemplatePlaceholderRecipientsFormPartial = ({ }; const onRemoveSigner = (index: number) => { + const isSelfSigner = signers[index].formId === selfSignerFormId; + removeSigner(index); - if (signers[index].formId === selfSignerFormId) { + if (isSelfSigner) { setSelfSignerFormId(undefined); } }; @@ -238,7 +242,7 @@ export const AddTemplatePlaceholderRecipientsFormPartial = ({