Skip to content

Commit def465c

Browse files
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>
1 parent 556d0d6 commit def465c

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

src/views/SignPDF/SignPDF.vue

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,17 @@ export default {
136136
this.pdfBlob = new File([blob], 'arquivo.pdf', { type: 'application/pdf' })
137137
},
138138
updateSigners(data) {
139-
this.signStore.document.signers.forEach(signer => {
140-
if (signer.visibleElements.length > 0) {
141-
signer.visibleElements.forEach(element => {
142-
const object = structuredClone(signer)
143-
object.readOnly = true
144-
element.coordinates.ury = Math.round(data.measurement[element.coordinates.page].height)
145-
- element.coordinates.ury
146-
object.element = element
147-
this.$refs.pdfEditor.addSigner(object)
148-
})
149-
}
150-
})
139+
const currentSigner = this.signStore.document.signers.find(signer => signer.me)
140+
if (currentSigner && currentSigner.visibleElements.length > 0) {
141+
currentSigner.visibleElements.forEach(element => {
142+
const object = structuredClone(currentSigner)
143+
object.readOnly = true
144+
element.coordinates.ury = Math.round(data.measurement[element.coordinates.page].height)
145+
- element.coordinates.ury
146+
object.element = element
147+
this.$refs.pdfEditor.addSigner(object)
148+
})
149+
}
151150
this.signStore.mounted = true
152151
},
153152
toggleSidebar() {

0 commit comments

Comments
 (0)