Address review feedback

This commit is contained in:
Greg Tatum 2025-10-30 09:48:46 -05:00
parent 26360c3e63
commit b7708da368
2 changed files with 3 additions and 4 deletions

View File

@ -1149,7 +1149,7 @@ const PDFViewerApplication = {
this.pdfViewer.setDocument(null); this.pdfViewer.setDocument(null);
this.pdfLinkService.setDocument(null); this.pdfLinkService.setDocument(null);
this.pdfDocumentProperties?.setDocument(null); this.pdfDocumentProperties?.setDocument(null);
this.pdfTextExtractor?.setDocument(null); this.pdfTextExtractor?.setViewer(null);
} }
this.pdfLinkService.externalLinkEnabled = true; this.pdfLinkService.externalLinkEnabled = true;
this.store = null; this.store = null;

View File

@ -50,7 +50,7 @@ class PdfTextExtractor {
for (const pendingRequest of this.#pendingRequests) { for (const pendingRequest of this.#pendingRequests) {
this.extractTextContent(pendingRequest); this.extractTextContent(pendingRequest);
} }
this.#pendingRequests = new Set(); this.#pendingRequests.clear();
} }
} }
@ -66,8 +66,7 @@ class PdfTextExtractor {
} }
if (!this.#textPromise) { if (!this.#textPromise) {
const textPromise = this.#pdfViewer.getAllText(); const textPromise = (this.#textPromise = this.#pdfViewer.getAllText());
this.#textPromise = textPromise;
// After the text resolves, cache the text for a little bit in case // After the text resolves, cache the text for a little bit in case
// multiple consumers call it. // multiple consumers call it.