From 439b43ae0dc07a8120541b5fea2c89b4d2efcd9c Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 18 Jan 2022 14:25:27 +0200 Subject: [PATCH] fixed cleanup of annotations after exclude/include --- .../file-preview-screen/file-preview-screen.component.ts | 9 +++++++++ 1 file changed, 9 insertions(+) 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 c387b3130..ed84d72ab 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 @@ -466,7 +466,16 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni } private async _reloadFile(file: File): Promise { + const previousFile = this.fileData?.file; await this._loadFileData(file); + + const fileHasBeenExcludedOrIncluded = previousFile?.excluded !== this.fileData?.file?.excluded; + const excludedPagesHaveChanged = JSON.stringify(previousFile?.excludedPages) !== JSON.stringify(this.fileData?.file?.excludedPages); + if (fileHasBeenExcludedOrIncluded || excludedPagesHaveChanged) { + await this._deleteAnnotations(); + await this._cleanupAndRedrawAnnotations(); + } + await this._stampPDF(); }