diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/viewer-header.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/viewer-header.service.ts index 2c6453be6..41b4d7d05 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/viewer-header.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/viewer-header.service.ts @@ -312,12 +312,15 @@ export class ViewerHeaderService { this._pdf.instance?.UI.updateElement('selectToolButton', { img: this.#convertPath('/assets/icons/general/pdftron-cursor.svg'), }); - this._tooltipsService.updateIconState(); - this._layersService.updateIconState(); - const closeCompareButton = this._pdf.instance.UI.iframeWindow.document.querySelector( - `[data-element=${HeaderElements.CLOSE_COMPARE_BUTTON}]`, - ); - closeCompareButton?.classList.add('active'); + + if (this._pdf.instance) { + this._tooltipsService.updateIconState(); + this._layersService.updateIconState(); + const closeCompareButton = this._pdf.instance.UI.iframeWindow.document.querySelector( + `[data-element=${HeaderElements.CLOSE_COMPARE_BUTTON}]`, + ); + closeCompareButton?.classList.add('active'); + } } disableLoadAllAnnotations(): void { diff --git a/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts b/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts index 208bc62cf..8cda2b996 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts +++ b/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts @@ -30,7 +30,6 @@ import { DocumentInfoService } from '../../../file-preview/services/document-inf import { ExcludedPagesService } from '../../../file-preview/services/excluded-pages.service'; import { PageRotationService } from '../../../pdf-viewer/services/page-rotation.service'; import { ViewerHeaderService } from '../../../pdf-viewer/services/viewer-header.service'; -import { ROTATION_ACTION_BUTTONS } from '../../../pdf-viewer/utils/constants'; import { AssignReviewerApproverDialogComponent } from '../../dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component'; import { DossiersDialogService } from '../../services/dossiers-dialog.service'; import { FileAssignService } from '../../services/file-assign.service'; @@ -410,7 +409,7 @@ export class FileActionsComponent implements OnChanges { const pageRotationService = this._injector.get(PageRotationService); await firstValueFrom(pageRotationService.showConfirmationDialogIfHasRotations()); const viewerHeaderService = this._injector.get(ViewerHeaderService); - viewerHeaderService.disable(ROTATION_ACTION_BUTTONS); + viewerHeaderService.disableRotationButtons(); this._loadingService.start(); await this._reanalysisService.ocrFiles([this.file], this.file.dossierId);