fix: pending document edit (#1580)

Fix issue where you cannot edit a pending document when there is a CCer
recipient.
This commit is contained in:
David Nguyen
2025-01-11 22:31:59 +11:00
committed by GitHub
parent 948d9c24cf
commit 08a69c6168
3 changed files with 20 additions and 5 deletions

View File

@ -8,8 +8,17 @@ export const formatSigningLink = (token: string) => `${NEXT_PUBLIC_WEBAPP_URL()}
* Whether a recipient can be modified by the document owner.
*/
export const canRecipientBeModified = (recipient: Recipient, fields: Field[]) => {
if (!recipient) {
return false;
}
// CCers can always be modified (unless document is completed).
if (recipient.role === RecipientRole.CC) {
return true;
}
// Deny if the recipient has already signed the document.
if (!recipient || recipient.signingStatus === SigningStatus.SIGNED) {
if (recipient.signingStatus === SigningStatus.SIGNED) {
return false;
}