Skip to content

Commit b7708da

Browse files
committed
Address review feedback
1 parent 26360c3 commit b7708da

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

web/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ const PDFViewerApplication = {
11491149
this.pdfViewer.setDocument(null);
11501150
this.pdfLinkService.setDocument(null);
11511151
this.pdfDocumentProperties?.setDocument(null);
1152-
this.pdfTextExtractor?.setDocument(null);
1152+
this.pdfTextExtractor?.setViewer(null);
11531153
}
11541154
this.pdfLinkService.externalLinkEnabled = true;
11551155
this.store = null;

web/pdf_text_extractor.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class PdfTextExtractor {
5050
for (const pendingRequest of this.#pendingRequests) {
5151
this.extractTextContent(pendingRequest);
5252
}
53-
this.#pendingRequests = new Set();
53+
this.#pendingRequests.clear();
5454
}
5555
}
5656

@@ -66,8 +66,7 @@ class PdfTextExtractor {
6666
}
6767

6868
if (!this.#textPromise) {
69-
const textPromise = this.#pdfViewer.getAllText();
70-
this.#textPromise = textPromise;
69+
const textPromise = (this.#textPromise = this.#pdfViewer.getAllText());
7170

7271
// After the text resolves, cache the text for a little bit in case
7372
// multiple consumers call it.

0 commit comments

Comments
 (0)