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 = {
} }
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…
Cancel
Save