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
@ -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…
x
Reference in New Issue
Block a user