Browse Source

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.
Jonas Jenwald 10 years ago
parent
commit
e5c4819601
  1. 6
      web/viewer.js

6
web/viewer.js

@ -886,10 +886,8 @@ var PDFViewerApplication = { @@ -886,10 +886,8 @@ var PDFViewerApplication = {
}
PDFHistory.initialize(self.documentFingerprint, self);
}
});
var storePromise = store.initializedPromise;
Promise.all([firstPagePromise, storePromise]).then(function resolved() {
store.initializedPromise.then(function resolved() {
var storedHash = null;
if (self.preferenceShowPreviousViewOnLoad &&
store.get('exists', false)) {
@ -916,8 +914,6 @@ var PDFViewerApplication = { @@ -916,8 +914,6 @@ var PDFViewerApplication = {
}
}, function rejected(reason) {
console.error(reason);
firstPagePromise.then(function () {
self.setInitialView(null, scale);
});
});

Loading…
Cancel
Save