fix: show only current signer's signature position

When viewing a document to sign, users should only see their own
signature positions, not the positions of other signers.

This improves UX and privacy by filtering to show only the signature
elements for the current signer (where signer.me === true).

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
Vitor Mattos 2025-12-16 22:41:28 -03:00
parent 42c025b122
commit 6de7b55668
No known key found for this signature in database
GPG key ID: 6FECE2AD4809003A

View file

@ -136,18 +136,17 @@ export default {
this.pdfBlob = new File([blob], 'arquivo.pdf', { type: 'application/pdf' })
},
updateSigners(data) {
this.signStore.document.signers.forEach(signer => {
if (signer.visibleElements.length > 0) {
signer.visibleElements.forEach(element => {
const object = structuredClone(signer)
object.readOnly = true
element.coordinates.ury = Math.round(data.measurement[element.coordinates.page].height)
- element.coordinates.ury
object.element = element
this.$refs.pdfEditor.addSigner(object)
})
}
})
const currentSigner = this.signStore.document.signers.find(signer => signer.me)
if (currentSigner && currentSigner.visibleElements.length > 0) {
currentSigner.visibleElements.forEach(element => {
const object = structuredClone(currentSigner)
object.readOnly = true
element.coordinates.ury = Math.round(data.measurement[element.coordinates.page].height)
- element.coordinates.ury
object.element = element
this.$refs.pdfEditor.addSigner(object)
})
}
this.signStore.mounted = true
},
toggleSidebar() {