diff options
author | bobzel <zzzman@gmail.com> | 2021-03-13 09:27:25 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-03-13 09:27:25 -0500 |
commit | df0c30a1f8c1a507be7582a9c97dc5546ae719c8 (patch) | |
tree | 9c489f866f68aac465f2e7a7d59d68c4fe056788 /src/client/views/DocComponent.tsx | |
parent | b18d4d2b9a4a624e61116642d4dbfe9a53437d0c (diff) |
fixed marquee annotations on pdfs from crashing - still need to fix offset problem.
Diffstat (limited to 'src/client/views/DocComponent.tsx')
-rw-r--r-- | src/client/views/DocComponent.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index 1d4b67deb..589cfafc5 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -190,7 +190,9 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps, T } else { added.map(doc => doc.context = this.props.Document); - (targetDataDoc[annotationKey ?? this.annotationKey] as List<Doc>).push(...added); + const annoDocs = targetDataDoc[annotationKey ?? this.annotationKey] as List<Doc>; + if (annoDocs) annoDocs.push(...added); + else targetDataDoc[annotationKey ?? this.annotationKey] = new List<Doc>(added); targetDataDoc[(annotationKey ?? this.annotationKey) + "-lastModified"] = new DateField(new Date(Date.now())); } } |