refactor(annotations): replace global element index with element.id in generateId
- Removed global __elementIndex counter and updated generateId() to use element.id for unique annotation IDs. - Updated createAnnotations() and createImageAnnotation() to pass element.id to generateId(). - Simplified ID generation logic for better consistency and traceability across annotations.
This commit is contained in:
@@ -90,6 +90,7 @@ class App {
|
||||
imageAttachmentId,
|
||||
this.envelopeReceiver.envelopeId,
|
||||
this.envelopeReceiver.receiverId,
|
||||
this.fakeElementId--,
|
||||
'signature'
|
||||
)
|
||||
|
||||
@@ -281,11 +282,7 @@ class App {
|
||||
.map(a => a.toJS())
|
||||
.filter(a => a.isSignature)
|
||||
|
||||
if (totalSignatures > filtered.length) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
return totalSignatures <= filtered.length
|
||||
}
|
||||
|
||||
async handleReset(event) {
|
||||
@@ -302,4 +299,6 @@ class App {
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
fakeElementId = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user