mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Improve how we disable PDFThumbnailView.setImage
for documents with Optional Content (PR 12170 follow-up)
Rather than always disable `PDFThumbnailView.setImage` as soon as user has changed the visibility of the Optional Content, we can utilize the new method added in the previous patch to improve thumbnail performance. Note in particular how, in the old code, even *resetting* of the Optional Content to its default state wouldn't enable `PDFThumbnailView.setImage` again. While slightly unrelated, this patch also removes the `PDFThumbnailViewer._optionalContentConfigPromise`-property since it's completely unused.
This commit is contained in:
parent
ceb4f8a6ab
commit
3446f15bf3
4 changed files with 38 additions and 25 deletions
|
@ -1824,6 +1824,7 @@ class BaseViewer {
|
|||
return Promise.resolve(null);
|
||||
}
|
||||
if (!this._optionalContentConfigPromise) {
|
||||
console.error("optionalContentConfigPromise: Not initialized yet.");
|
||||
// Prevent issues if the getter is accessed *before* the `onePageRendered`
|
||||
// promise has resolved; won't (normally) happen in the default viewer.
|
||||
return this.pdfDocument.getOptionalContentConfig();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue