Merge branch 'VM/RED-7980' into 'master'

RED-7980 - stop searching when another page has been reached

Closes RED-7980

See merge request redactmanager/red-ui!352
This commit is contained in:
Dan Percic 2024-03-20 14:03:49 +01:00
commit 65f2ef0e74

View File

@ -313,8 +313,12 @@ export class FileDataService extends EntitiesService<AnnotationWrapper, Annotati
#findOriginalAnnotation(annotations: AnnotationWrapper[], pendingEntry: IEntityLogEntry) {
for (let i = annotations.length - 1; i >= 0; i--) {
if (annotations[i].id === pendingEntry.id) {
return annotations[i];
const annotation = annotations[i];
if (annotation.positions[0].page !== pendingEntry.positions[0].pageNumber) {
return;
}
if (annotation.id === pendingEntry.id) {
return annotation;
}
}
}