From 30c112b743b347a609ec5669be6c2f198db93e6d Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Wed, 21 Oct 2020 17:49:50 +0300 Subject: [PATCH] fixed ngzone for open aswell --- .../file-preview-screen.component.html | 2 -- .../file-preview-screen.component.ts | 20 ++++++------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html index 95bae11fc..01570fd13 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html @@ -149,6 +149,4 @@ - - diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts index 0797957d1..9ea60c614 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts @@ -37,7 +37,6 @@ export class FilePreviewScreenComponent implements OnInit { private _readyViewers: string[] = []; private projectId: string; private _activeViewer: 'ANNOTATED' | 'REDACTED' = 'ANNOTATED'; - private _manualRedactionEntry: AddRedactionRequest; @ViewChild(PdfViewerComponent) private _viewerComponent: PdfViewerComponent; @ViewChild('annotations') private _annotationsElement: ElementRef; @@ -167,19 +166,12 @@ export class FilePreviewScreenComponent implements OnInit { } handleManualAnnotationRequest($event: ManualRedactionEntry) { - this._manualRedactionEntry = $event; - document.getElementById('open-manual-redaction-dialog-btn').click(); - } - - openManualRedactionDialog() { - const ref = this._dialog.open(ManualRedactionDialogComponent, { - width: '600px', - maxWidth: '90vw', - data: this._manualRedactionEntry - }); - - ref.afterClosed().subscribe(() => { - this._manualRedactionEntry = null; + this.ngZone.run(() => { + this._dialog.open(ManualRedactionDialogComponent, { + width: '600px', + maxWidth: '90vw', + data: $event + }); }); }