diff options
| author | bobzel <zzzman@gmail.com> | 2020-08-02 08:57:35 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-08-02 08:57:35 -0400 |
| commit | 4792b8875f27770882943c8dc0ef021d22a37c06 (patch) | |
| tree | 2afceaa3b363fde42b2def8359ab657a609fe442 /src/client/views/pdf/PDFViewer.tsx | |
| parent | 6d02ae9f9c09c27fa8da87afbd1307240dcb9289 (diff) | |
changed highlight() calls in PdfViewer and WebBox
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
| -rw-r--r-- | src/client/views/pdf/PDFViewer.tsx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index 59fa6b08c..b81baf417 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -566,12 +566,9 @@ export class PDFViewer extends ViewBoxAnnotatableComponent<IViewerProps, PdfDocu highlight = (color: string) => { // creates annotation documents for current highlights const effectiveAcl = GetEffectiveAcl(this.props.Document); - if ([AclAddonly, AclEdit, AclAdmin].includes(effectiveAcl)) { - const annotationDoc = this.makeAnnotationDocument(color); - annotationDoc && Doc.AddDocToList(this.props.Document, this.annotationKey, annotationDoc); - return annotationDoc; - } - return undefined; + const annotationDoc = [AclAddonly, AclEdit, AclAdmin].includes(effectiveAcl) && this.makeAnnotationDocument(color); + annotationDoc && this.addDocument?.(annotationDoc); + return annotationDoc ?? undefined; } /** |
