aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-12-13 15:48:13 -0500
committerSam Wilkins <samwilkins333@gmail.com>2019-12-13 15:48:13 -0500
commit594fc55d17f6e2b912cefec56a0217990673c04c (patch)
tree37ccb575c84c4a9a0221b5c01533c2114871f01a /src
parentd4f793d73070594086c72cf67a8b2b0a60b2af77 (diff)
absolute pathname to pdfbox, improved check
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/PDFBox.tsx2
-rw-r--r--src/client/views/pdf/PDFViewer.tsx2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx
index 0f5cc0fa9..af996b3d8 100644
--- a/src/client/views/nodes/PDFBox.tsx
+++ b/src/client/views/nodes/PDFBox.tsx
@@ -57,7 +57,7 @@ export class PDFBox extends DocAnnotatableComponent<FieldViewProps, PdfDocument>
componentDidMount() {
const pdfUrl = Cast(this.dataDoc[this.props.fieldKey], PdfField);
if (pdfUrl instanceof PdfField) {
- Pdfjs.getDocument(pdfUrl.url.pathname).promise.then(pdf => runInAction(() => this._pdf = pdf));
+ Pdfjs.getDocument(pdfUrl.url.href).promise.then(pdf => runInAction(() => this._pdf = pdf));
}
this._selectReactionDisposer = reaction(() => this.props.isSelected(),
() => {
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 253968443..41825cda7 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -137,7 +137,7 @@ export class PDFViewer extends DocAnnotatableComponent<IViewerProps, PdfDocument
const properPath = Utils.prepend(`/files/pdfs/${matches[0]}`);
console.log(properPath);
console.log(`The two (url and proper path) ${url === properPath ? "were" : "were not equal"}`);
- if (url !== properPath) {
+ if (!properPath.includes(url)) {
const proto = Doc.GetProto(Document);
proto[this.props.fieldKey] = new PdfField(properPath);
proto[backup] = url;