From 02aa5610034bdbfb2f9b410038126dd407203853 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 30 Jul 2023 17:13:39 +0200 Subject: [PATCH] Ensure that the password dialog is always closed with the document If the current PDF document is closed while the password dialog is open, e.g. manually by calling `PDFViewerApplication.close()` from the console, the password dialog wouldn't be closed as intended. *Please note:* This could only affect the GENERIC viewer, although it's very unlikely to ever happen, since that's the only one that supports opening more than one PDF document. --- web/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/app.js b/web/app.js index 451d05f76..b3a1cf055 100644 --- a/web/app.js +++ b/web/app.js @@ -1005,7 +1005,10 @@ const PDFViewerApplication = { this._saveInProgress = false; this._hasAnnotationEditors = false; - promises.push(this.pdfScriptingManager.destroyPromise); + promises.push( + this.pdfScriptingManager.destroyPromise, + this.passwordPrompt.close() + ); this.setTitle(); this.pdfSidebar?.reset();