From 6e931b6006fc64f4712d20e7afcaf14ac0b57d5b Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Wed, 20 Mar 2024 15:01:09 +0200 Subject: [PATCH] RED-7980 - stop searching when another page has been reached --- .../modules/file-preview/services/file-data.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/services/file-data.service.ts b/apps/red-ui/src/app/modules/file-preview/services/file-data.service.ts index 8c433c921..90bc7b784 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/file-data.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/file-data.service.ts @@ -313,8 +313,12 @@ export class FileDataService extends EntitiesService= 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; } } }