From 6b5750c7bf8e8af051872bd49068381b11b8b3de Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Mon, 29 Apr 2024 17:48:00 +0530 Subject: [PATCH] chore: revert previous changes --- .../primitives/document-flow/add-signers.tsx | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/packages/ui/primitives/document-flow/add-signers.tsx b/packages/ui/primitives/document-flow/add-signers.tsx index b62d4c433..2f9f2f234 100644 --- a/packages/ui/primitives/document-flow/add-signers.tsx +++ b/packages/ui/primitives/document-flow/add-signers.tsx @@ -116,7 +116,6 @@ export const AddSignersFormPartial = ({ const onFormSubmit = form.handleSubmit(onSubmit); - const { append: appendSigner, fields: signers, @@ -125,7 +124,7 @@ export const AddSignersFormPartial = ({ control, name: 'signers', }); - + const hasBeenSentToRecipientId = (id?: number) => { if (!id) { return false; @@ -139,6 +138,16 @@ export const AddSignersFormPartial = ({ ); }; + const onAddSelfSigner = () => { + appendSigner({ + formId: nanoid(12), + name: user?.name ?? '', + email: user?.email ?? '', + role: RecipientRole.SIGNER, + actionAuth: undefined, + }); + }; + const onAddSigner = () => { appendSigner({ formId: nanoid(12), @@ -165,20 +174,6 @@ export const AddSignersFormPartial = ({ removeSigner(index); }; - const onAddSelfSigner = () => { - const lastSignerIndex = signers.length - 1; - if(!signers[lastSignerIndex].name || !signers[lastSignerIndex].email){ - onRemoveSigner(lastSignerIndex) - } - appendSigner({ - formId: nanoid(12), - name: user?.name ?? '', - email: user?.email ?? '', - role: RecipientRole.SIGNER, - actionAuth: undefined, - }); - }; - const onKeyDown = (event: React.KeyboardEvent) => { if (event.key === 'Enter' && event.target instanceof HTMLInputElement) { onAddSigner(); @@ -307,10 +302,10 @@ export const AddSignersFormPartial = ({ global action signing authentication method configured in the "General Settings" step -
  • + {/*
  • Require account - The recipient must be signed in -
  • + */}
  • Require passkey - The recipient must have an account and passkey configured via their settings @@ -331,11 +326,13 @@ export const AddSignersFormPartial = ({ {/* Note: -1 is remapped in the Zod schema to the required value. */} Inherit authentication method - {Object.values(RecipientActionAuth).map((authType) => ( - - {DOCUMENT_AUTH_TYPES[authType].value} - - ))} + {Object.values(RecipientActionAuth) + .filter((auth) => auth !== RecipientActionAuth.ACCOUNT) + .map((authType) => ( + + {DOCUMENT_AUTH_TYPES[authType].value} + + ))}