Skip to content

Commit bcdb5bb

Browse files
committed
fix(SigningRequirementValidator): remove signerHasSignRequest shortcut that bypassed visibleElements check
The shortcut added in e9ea794 caused needsCreateSignature to return true whenever the signer had a signRequestId, regardless of whether any visual element box was placed. This silently opened the draw modal for clickToSign documents with no placed elements. Remove the shortcut and keep only the visibleElements.some() check, also normalising signRequestId comparison to String() to be type-safe. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent f78030e commit bcdb5bb

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/services/SigningRequirementValidator.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ interface ValidatorConfig {
3535
errors?: Array<{ code?: number; [key: string]: unknown }>
3636
hasSignatures?: boolean
3737
canCreateSignature?: boolean
38-
signerHasSignRequest?: boolean
3938
[key: string]: unknown
4039
}
4140

@@ -122,11 +121,7 @@ export class SigningRequirementValidator {
122121
return false
123122
}
124123

125-
if (config.signerHasSignRequest) {
126-
return true
127-
}
128-
129124
const visibleElements = this.signStore.document?.visibleElements || []
130-
return visibleElements.some(row => row.signRequestId === signRequestId)
125+
return visibleElements.some(row => String(row.signRequestId) === String(signRequestId))
131126
}
132127
}

0 commit comments

Comments
 (0)