From 7d5c878e6a02ef0d5f762134f5a878612321efbe Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Thu, 14 Mar 2024 14:36:26 +0200 Subject: [PATCH] RED-8753: fixed images disappearing upon aborting resize. --- .../pdf-viewer/services/annotation-manager.service.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-manager.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-manager.service.ts index efec37cac..8472bdd93 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-manager.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-manager.service.ts @@ -140,12 +140,16 @@ export class REDAnnotationManager { #listenForAnnotationSelected() { this.#manager.addEventListener('annotationSelected', (annotations: Annotation[], action: string) => { this.#logger.info('[PDF] Annotation selected: ', annotations, action); - this.#annotationSelected$.next([annotations, action]); - const annotation = annotations.length === 1 ? annotations[0] : undefined; - if (annotation && annotation.ToolName === AnnotationToolNames.AnnotationCreateRectangle && action === 'deselected') { + if ( + annotation && + annotation.ToolName === AnnotationToolNames.AnnotationCreateRectangle && + action === 'deselected' && + !this.resizingAnnotationId + ) { this.delete(annotation.Id); } + this.#annotationSelected$.next([annotations, action]); }); }