From d74dbde308190443f9322e40a391f7f087c2c07b Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 13 Aug 2020 12:48:51 +0200 Subject: [PATCH] Wait until saving has finished before resetting `PDFViewerApplication._saveInProgress` (PR 12137 follow-up) I obviously missed this during review, but currently `PDFViewerApplication._saveInProgress` is reset *synchronously* in `PDFViewerApplication.save`. That was probably not intended, since it essentially renders the `PDFViewerApplication._saveInProgress` check pointless given that the actual saving is an *asynchronously* operation. --- web/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/app.js b/web/app.js index 4bd905ceeb8eed..039f7af29ebf57 100644 --- a/web/app.js +++ b/web/app.js @@ -939,8 +939,10 @@ const PDFViewerApplication = { }) .catch(() => { this.download(); - }); // Error occurred, try downloading with the URL. - this._saveInProgress = false; + }) + .finally(() => { + this._saveInProgress = false; + }); }, /**