Skip Promise.all in PDFViewerApplication._parseHashParameters unless actually necessary

Given that only two debugging hash parameters (i.e. `disableWorker` and `pdfBug`) will make this method asynchronous, we can avoid what's most of the time is an unnecessary `Promise.all` invocation.
This commit is contained in:
Jonas Jenwald 2020-11-17 13:37:21 +01:00
parent a06f487bd4
commit 4886a7cf69

View File

@ -385,6 +385,9 @@ const PDFViewerApplication = {
AppOptions.set("locale", hashParams.locale);
}
if (waitOn.length === 0) {
return undefined;
}
return Promise.all(waitOn).catch(reason => {
console.error(`_parseHashParameters: "${reason.message}".`);
});