From 22cb59e7d0eaee8937188cb6d4e03497e309e439 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 *asynchronous* operation. --- web/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/app.js b/web/app.js index 4bd905cee..039f7af29 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; + }); }, /**