Merge pull request #15215 from Snuffleupagus/optional-content-initial

[api-minor] Improve how we disable `PDFThumbnailView.setImage` for documents with Optional Content
This commit is contained in:
Tim van der Meij 2022-07-30 12:04:23 +02:00 committed by GitHub
commit c7b71a3376
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 140 additions and 62 deletions

View file

@ -1856,6 +1856,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();