From 25b581c2a9ac4037e10e3d840bea113eed1e5389 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 10 Feb 2021 15:56:15 +0100 Subject: [PATCH] Slightly simplify the parameter handling in `initPassiveLoading.onOpenWithURL` --- web/app.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/web/app.js b/web/app.js index a676ceb2c..73b287799 100644 --- a/web/app.js +++ b/web/app.js @@ -709,14 +709,9 @@ const PDFViewerApplication = { this.open(data); }, onOpenWithURL: (url, length, originalUrl) => { - let file = url, - args = null; - if (length !== undefined) { - args = { length }; - } - if (originalUrl !== undefined) { - file = { url, originalUrl }; - } + const file = originalUrl !== undefined ? { url, originalUrl } : url; + const args = length !== undefined ? { length } : null; + this.open(file, args); }, onError: err => {