From fb1ad24cb6e5d90d544441c4234ec81c5b81a0c8 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 11 Jan 2022 17:30:43 +0200 Subject: [PATCH] redraw current page only of not already procexxing --- .../file-preview-screen.component.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 89d93bed1..53216bbbc 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 @@ -561,9 +561,15 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni } private async _reloadAnnotationsForPage(page: number) { - const currentPageAnnotations = this.visibleAnnotations.filter(a => a.pageNumber === page); - this.fileData.file = await this._filesService.reload(this.dossierId, this.fileId).toPromise(); + + // if this action triggered a re-processing, + // we don't want to redraw for this page since they will get redrawn as soon as processing ends; + if (this.fileData.file.isProcessing) { + return; + } + + const currentPageAnnotations = this.visibleAnnotations.filter(a => a.pageNumber === page); this.fileData.redactionLog = await this._fileDownloadService.loadRedactionLogFor(this.dossierId, this.fileId).toPromise(); await this._cleanupAndRedrawAnnotations(currentPageAnnotations, annotation => annotation.pageNumber === page);