mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Merge pull request #16375 from Snuffleupagus/pageViewsReady-tweak
Re-factor the `PDFViewer.pageViewsReady` getter slightly
This commit is contained in:
commit
e89da6d940
1 changed files with 4 additions and 6 deletions
|
@ -331,14 +331,12 @@ class PDFViewer {
|
||||||
* @type {boolean} - True if all {PDFPageView} objects are initialized.
|
* @type {boolean} - True if all {PDFPageView} objects are initialized.
|
||||||
*/
|
*/
|
||||||
get pageViewsReady() {
|
get pageViewsReady() {
|
||||||
if (!this._pagesCapability.settled) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Prevent printing errors when 'disableAutoFetch' is set, by ensuring
|
// Prevent printing errors when 'disableAutoFetch' is set, by ensuring
|
||||||
// that *all* pages have in fact been completely loaded.
|
// that *all* pages have in fact been completely loaded.
|
||||||
return this._pages.every(function (pageView) {
|
return (
|
||||||
return pageView?.pdfPage;
|
this._pagesCapability.settled &&
|
||||||
});
|
this._pages.every(pageView => pageView?.pdfPage)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue