fix: correct signer deletion (#1596)

This commit is contained in:
Ephraim Duncan
2025-03-12 05:05:45 +00:00
committed by GitHub
parent c646afcd97
commit fec078081b

View File

@@ -201,10 +201,12 @@ export const AddSignersFormPartial = ({
return; return;
} }
removeSigner(index); const formStateIndex = form.getValues('signers').findIndex((s) => s.formId === signer.formId);
if (formStateIndex !== -1) {
const updatedSigners = signers.filter((_, idx) => idx !== index); removeSigner(formStateIndex);
form.setValue('signers', normalizeSigningOrders(updatedSigners)); const updatedSigners = form.getValues('signers').filter((s) => s.formId !== signer.formId);
form.setValue('signers', normalizeSigningOrders(updatedSigners));
}
}; };
const onAddSelfSigner = () => { const onAddSelfSigner = () => {