diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/pdf-viewer/pdf-viewer.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/pdf-viewer/pdf-viewer.component.ts index ab1997a5f..fe7bd739d 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/pdf-viewer/pdf-viewer.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/pdf-viewer/pdf-viewer.component.ts @@ -457,7 +457,7 @@ export class PdfViewerComponent extends AutoUnsubscribe implements OnInit, OnCha this.instance.UI.annotationPopup.update([]); if (annotationWrappers.length === 0) { - this._configureRectangleAnnotationPopup(); + this._configureRectangleAnnotationPopup(viewerAnnotations[0]); return; } @@ -497,16 +497,18 @@ export class PdfViewerComponent extends AutoUnsubscribe implements OnInit, OnCha this.instance.UI.annotationPopup.add(actions); } - private _configureRectangleAnnotationPopup() { - this.instance.UI.annotationPopup.add([ - { - type: 'actionButton', - dataElement: dataElements.ADD_RECTANGLE, - img: this._convertPath('/assets/icons/general/pdftron-action-add-redaction.svg'), - title: this._translateService.instant(this._manualAnnotationService.getTitle('REDACTION', this.dossier)), - onClick: () => this._addRectangleManualRedaction(), - }, - ]); + private _configureRectangleAnnotationPopup(annotation: Annotation) { + if (!this.viewModeService.isCompare || annotation.getPageNumber() % 2 === 1) { + this.instance.UI.annotationPopup.add([ + { + type: 'actionButton', + dataElement: dataElements.ADD_RECTANGLE, + img: this._convertPath('/assets/icons/general/pdftron-action-add-redaction.svg'), + title: this._translateService.instant(this._manualAnnotationService.getTitle('REDACTION', this.dossier)), + onClick: () => this._addRectangleManualRedaction(), + }, + ]); + } } private _addRectangleManualRedaction() {