RED-3012: Only app loading indicator in file preview

This commit is contained in:
Adina Țeudan 2021-12-13 14:25:04 +02:00
parent e103418ea6
commit f46a911470
3 changed files with 8 additions and 1 deletions

View File

@ -79,6 +79,7 @@
*ngIf="displayPdfViewer"
[annotations]="annotations"
[canPerformActions]="canPerformAnnotationActions$ | async"
[class.hidden]="!ready"
[dossier]="dossier"
[fileData]="fileData?.fileData"
[file]="file"

View File

@ -62,3 +62,7 @@
max-width: 400px;
width: 400px;
}
redaction-pdf-viewer.hidden {
visibility: hidden;
}

View File

@ -84,6 +84,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
readonly viewDocumentInfo$: Observable<boolean>;
readonly file$: Observable<File>;
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<void> {
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();