From 63f2f4927f0fd3e4d1d74b91599bc585fe820a29 Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 16 Oct 2020 00:45:17 -0400 Subject: fixed some exceptions. added text field to annotations on PDFs --- src/client/views/pdf/Annotation.tsx | 2 +- src/client/views/pdf/PDFViewer.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/client/views/pdf/Annotation.tsx b/src/client/views/pdf/Annotation.tsx index a071abd21..20ea7bfe4 100644 --- a/src/client/views/pdf/Annotation.tsx +++ b/src/client/views/pdf/Annotation.tsx @@ -100,7 +100,7 @@ class RegionAnnotation extends React.Component { group.isPushpin = !group.isPushpin; }); - isPushpin = () => BoolCast(Cast(this.props.document.group, Doc, null).isPushpin); + isPushpin = () => BoolCast(Cast(this.props.document.group, Doc, null)?.isPushpin); @action onPointerDown = (e: React.PointerEvent) => { diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index d8be3defd..974d87fc7 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -353,6 +353,7 @@ export class PDFViewer extends ViewBoxAnnotatableComponent(annoDocs); } mainAnnoDocProto.title = "Annotation on " + this.Document.title; @@ -402,7 +403,7 @@ export class PDFViewer extends ViewBoxAnnotatableComponent { - this.Document._scrollY === undefined && (this.layoutDoc._scrollTop = this._mainCont.current!.scrollTop); + this.Document._scrollY === undefined && this._mainCont.current && (this.layoutDoc._scrollTop = this._mainCont.current.scrollTop); this.pageDelay = undefined; //this._pdfViewer && (this.Document._curPage = this._pdfViewer.currentPageNumber); }, 1000); @@ -543,8 +544,7 @@ export class PDFViewer extends ViewBoxAnnotatableComponent