mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Merge pull request #12135 from Snuffleupagus/pdfManagerReady-loadDocument-promise
[src/core/worker.js] Remove a useless Promise handler from the `pdfManagerReady` function
This commit is contained in:
commit
bcbbd03f7b
1 changed files with 13 additions and 17 deletions
|
@ -371,25 +371,21 @@ class WorkerMessageHandler {
|
|||
function pdfManagerReady() {
|
||||
ensureNotTerminated();
|
||||
|
||||
loadDocument(false).then(
|
||||
onSuccess,
|
||||
function loadFailure(ex) {
|
||||
loadDocument(false).then(onSuccess, function (reason) {
|
||||
ensureNotTerminated();
|
||||
|
||||
// Try again with recoveryMode == true
|
||||
if (!(reason instanceof XRefParseException)) {
|
||||
onFailure(reason);
|
||||
return;
|
||||
}
|
||||
pdfManager.requestLoadedStream();
|
||||
pdfManager.onLoadedStream().then(function () {
|
||||
ensureNotTerminated();
|
||||
|
||||
// Try again with recoveryMode == true
|
||||
if (!(ex instanceof XRefParseException)) {
|
||||
onFailure(ex);
|
||||
return;
|
||||
}
|
||||
pdfManager.requestLoadedStream();
|
||||
pdfManager.onLoadedStream().then(function () {
|
||||
ensureNotTerminated();
|
||||
|
||||
loadDocument(true).then(onSuccess, onFailure);
|
||||
});
|
||||
},
|
||||
onFailure
|
||||
);
|
||||
loadDocument(true).then(onSuccess, onFailure);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
ensureNotTerminated();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue