Slightly simplify the parameter handling in initPassiveLoading.onOpenWithURL

This commit is contained in:
Jonas Jenwald 2021-02-10 15:56:15 +01:00
parent b375a867eb
commit 25b581c2a9

View File

@ -709,14 +709,9 @@ const PDFViewerApplication = {
this.open(data); this.open(data);
}, },
onOpenWithURL: (url, length, originalUrl) => { onOpenWithURL: (url, length, originalUrl) => {
let file = url, const file = originalUrl !== undefined ? { url, originalUrl } : url;
args = null; const args = length !== undefined ? { length } : null;
if (length !== undefined) {
args = { length };
}
if (originalUrl !== undefined) {
file = { url, originalUrl };
}
this.open(file, args); this.open(file, args);
}, },
onError: err => { onError: err => {