aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/WebBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/WebBox.tsx')
-rw-r--r--src/client/views/nodes/WebBox.tsx9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx
index 3fbebe3e6..646a94aa7 100644
--- a/src/client/views/nodes/WebBox.tsx
+++ b/src/client/views/nodes/WebBox.tsx
@@ -536,12 +536,9 @@ export class WebBox extends ViewBoxAnnotatableComponent<FieldViewProps, WebDocum
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;
}
/**
* This is temporary for creating annotations from highlights. It will