mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
Small refactoring of the code that calls |PDFViewerApplication.setInitialView|
This is a minor cleanup, to avoid an unnecessary `Promise.all` and to simplify catching |ViewHistory| errors.
This commit is contained in:
parent
6091e7bd6b
commit
e5c4819601
1 changed files with 23 additions and 27 deletions
|
@ -886,10 +886,8 @@ var PDFViewerApplication = {
|
||||||
}
|
}
|
||||||
PDFHistory.initialize(self.documentFingerprint, self);
|
PDFHistory.initialize(self.documentFingerprint, self);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
var storePromise = store.initializedPromise;
|
store.initializedPromise.then(function resolved() {
|
||||||
Promise.all([firstPagePromise, storePromise]).then(function resolved() {
|
|
||||||
var storedHash = null;
|
var storedHash = null;
|
||||||
if (self.preferenceShowPreviousViewOnLoad &&
|
if (self.preferenceShowPreviousViewOnLoad &&
|
||||||
store.get('exists', false)) {
|
store.get('exists', false)) {
|
||||||
|
@ -916,8 +914,6 @@ var PDFViewerApplication = {
|
||||||
}
|
}
|
||||||
}, function rejected(reason) {
|
}, function rejected(reason) {
|
||||||
console.error(reason);
|
console.error(reason);
|
||||||
|
|
||||||
firstPagePromise.then(function () {
|
|
||||||
self.setInitialView(null, scale);
|
self.setInitialView(null, scale);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue