diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html index c1a6573a4..3b8387637 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html @@ -79,6 +79,7 @@ *ngIf="displayPdfViewer" [annotations]="annotations" [canPerformActions]="canPerformAnnotationActions$ | async" + [class.hidden]="!ready" [dossier]="dossier" [fileData]="fileData?.fileData" [file]="file" diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.scss b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.scss index d29663f2a..bfbe391d2 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.scss +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.scss @@ -62,3 +62,7 @@ max-width: 400px; width: 400px; } + +redaction-pdf-viewer.hidden { + visibility: hidden; +} diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index e802c64a7..5be2282b7 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -84,6 +84,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni readonly viewDocumentInfo$: Observable; readonly file$: Observable; readonly fileId: string; + ready = false; private _instance: WebViewerInstance; private _lastPage: string; private _reloadFileOnReanalysis = false; @@ -225,10 +226,10 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni await this.ngOnInit(); this._lastPage = previousRoute.queryParams.page; this._changeDetectorRef.markForCheck(); - this._loadingService.stop(); } async ngOnInit(): Promise { + this.ready = false; this._loadingService.start(); await this.userPreferenceService.saveLastOpenedFileForDossier(this.dossierId, this.fileId); this._subscribeToFileUpdates(); @@ -403,6 +404,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni async viewerReady($event: WebViewerInstance) { this._instance = $event; + this.ready = true; await this._stampPDF(); await this._cleanupAndRedrawManualAnnotations(); this._setExcludedPageStyles();