aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/PDFViewer.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-06-18 09:05:41 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-06-18 09:05:41 -0400
commit64e6a941639aab8d7109178aa151a50909547309 (patch)
tree7d08264804a59efe7aa17bd1821faeb5a4059a7c /src/client/views/pdf/PDFViewer.tsx
parent4b8324fcf44c5d3c3a4b3f6e98a4d1dfce84811b (diff)
fixed index out of range
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
-rw-r--r--src/client/views/pdf/PDFViewer.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index e5fb32e53..89f4fd778 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -111,13 +111,14 @@ class Viewer extends React.Component<IViewerProps> {
initialLoad = async () => {
if (this._pageSizes.length === 0) {
let pageSizes = Array<{ width: number, height: number }>(this.props.pdf.numPages);
+ this._isPage = Array<string>(this.props.pdf.numPages);
for (let i = 0; i < this.props.pdf.numPages; i++) {
await this.props.pdf.getPage(i + 1).then(page => runInAction(() =>
pageSizes[i] = { width: page.view[2] * scale, height: page.view[3] * scale }));
}
- this.props.loaded(pageSizes[0].width, pageSizes[0].height, this.props.pdf.numPages);
runInAction(() =>
- Array.from(Array((this._pageSizes = pageSizes).length).keys()).map(this.getPlaceholderPage))
+ Array.from(Array((this._pageSizes = pageSizes).length).keys()).map(this.getPlaceholderPage));
+ this.props.loaded(pageSizes[0].width, pageSizes[0].height, this.props.pdf.numPages);
}
}