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

This commit is contained in:
Valentin Mihai 2024-03-20 15:01:09 +02:00
parent f518e508ca
commit 6e931b6006

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;
}
}
}