aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-09-27 10:22:59 -0400
committerbobzel <zzzman@gmail.com>2020-09-27 10:22:59 -0400
commite301d23c10d4dd9b7677100bdeba1b02998bf8ac (patch)
tree77337e23170d72d852f4e8c3904a11f168447c0b /src/client/views/pdf
parentf015bdbbb4c5b9fcf5983ccf593c9405d1303666 (diff)
fixed loading of pdfs
Diffstat (limited to 'src/client/views/pdf')
-rw-r--r--src/client/views/pdf/PDFViewer.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 17d8203cb..6179f81fd 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -134,7 +134,7 @@ export class PDFViewer extends ViewBoxAnnotatableComponent<IViewerProps, PdfDocu
const coreFilename = pathComponents.pop()!.split(".")[0];
const params: any = {
coreFilename,
- pageNum: Math.min(this.props.pdf.numPages, Math.max(0, this.Document._curPage || 1)),
+ pageNum: Math.min(this.props.pdf.numPages, Math.max(1, this.Document._curPage || 1)),
};
if (pathComponents.length) {
params.subtree = `${pathComponents.join("/")}/`;
@@ -143,7 +143,7 @@ export class PDFViewer extends ViewBoxAnnotatableComponent<IViewerProps, PdfDocu
} else {
const params: any = {
coreFilename: relative.split("/")[relative.split("/").length - 1],
- pageNum: Math.min(this.props.pdf.numPages, Math.max(0, this.Document._curPage || 1)),
+ pageNum: Math.min(this.props.pdf.numPages, Math.max(1, this.Document._curPage || 1)),
};
this._coverPath = "http://cs.brown.edu/~bcz/face.gif";//href.startsWith(window.location.origin) ? await Networking.PostToServer("/thumbnail", params) : { width: 100, height: 100, path: "" };
}