aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-12-13 17:04:23 -0500
committerSam Wilkins <samwilkins333@gmail.com>2019-12-13 17:04:23 -0500
commit6e6c4f7fd6b36cae11b9dc5089e672f457d5944f (patch)
tree22e2b8ff47c209ca9b6639d84098f98e7062869c
parent0ec21e2525feebe2fcd96fe5e0e3bc113ae3340e (diff)
added re-write check to constructor
-rw-r--r--src/client/views/pdf/PDFViewer.tsx14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 450add208..648522cd9 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -121,11 +121,8 @@ export class PDFViewer extends DocAnnotatableComponent<IViewerProps, PdfDocument
return this._annotations.filter(anno => this._script.run({ this: anno }, console.log, true).result);
}
- _lastSearch: string = "";
- componentDidMount = async () => {
- !this.props.Document.lockedTransform && (this.props.Document.lockedTransform = true);
- // change the address to be the file address of the PNG version of each page
- // file address of the pdf
+ constructor(props: any) {
+ super(props);
const backup = "oldPath";
const { url, Document } = this.props;
const pathCorrectionTest = /upload\_[a-z0-9]{32}.(.*)/g;
@@ -147,6 +144,13 @@ export class PDFViewer extends DocAnnotatableComponent<IViewerProps, PdfDocument
} else {
console.log("Outer matches was null!");
}
+ }
+
+ _lastSearch: string = "";
+ componentDidMount = async () => {
+ !this.props.Document.lockedTransform && (this.props.Document.lockedTransform = true);
+ // change the address to be the file address of the PNG version of each page
+ // file address of the pdf
const path = Utils.prepend(`/thumbnail${this.props.url.substring("files/pdfs/".length, this.props.url.length - ".pdf".length)}-${(this.Document.curPage || 1)}.png`);
this._coverPath = JSON.parse(await rp.get(path));
runInAction(() => this._showWaiting = this._showCover = true);