diff --git a/web/app.js b/web/app.js index d8dd9e953..8bcb86f20 100644 --- a/web/app.js +++ b/web/app.js @@ -1073,22 +1073,12 @@ const PDFViewerApplication = { ); }, - /** - * @private - */ - _ensureDownloadComplete() { - if (this.pdfDocument && this.downloadComplete) { - return; - } - throw new Error("PDF document not downloaded."); - }, - async download(options = {}) { let data; try { - this._ensureDownloadComplete(); - - data = await this.pdfDocument.getData(); + if (this.downloadComplete) { + data = await this.pdfDocument.getData(); + } } catch { // When the PDF document isn't ready, or the PDF file is still // downloading, simply download using the URL.