mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
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:
parent
a06f487bd4
commit
4886a7cf69
1 changed files with 3 additions and 0 deletions
|
@ -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}".`);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue