From 905750f6625ed1f11242cd0e0ea52e4e5a606c96 Mon Sep 17 00:00:00 2001 From: Eleanor Eng Date: Tue, 4 Jun 2019 10:41:07 -0400 Subject: merge --- src/client/views/nodes/PDFBox.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index aa29a7170..6b5f5ab65 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -261,7 +261,7 @@ export class PDFBox extends DocComponent(PdfDocumen this.props.Document.thumbnail = new ImageField(new URL(url)); } runInAction(() => this._renderAsSvg = true); - }) + }); })) .catch(function (error: any) { console.error('oops, something went wrong!', error); @@ -335,8 +335,9 @@ export class PDFBox extends DocComponent(PdfDocumen } choosePath(url: URL) { - if (url.protocol === "data" || url.href.indexOf(window.location.origin) === -1) + if (url.protocol === "data" || url.href.indexOf(window.location.origin) === -1) { return url.href; + } let ext = path.extname(url.href); return url.href.replace(ext, this._curSuffix + ext); } @@ -350,8 +351,9 @@ export class PDFBox extends DocComponent(PdfDocumen } @action onError = () => { let timeout = this._curSuffix === "_s" ? this._smallRetryCount : this._curSuffix === "_m" ? this._mediumRetryCount : this._largeRetryCount; - if (timeout < 10) + if (timeout < 10) { setTimeout(this.retryPath, Math.min(10000, timeout * 5)); + } } _curSuffix = "_m"; -- cgit v1.2.3-70-g09d2