Skip to content

Commit

Permalink
Wait until saving has finished before resetting `PDFViewerApplication…
Browse files Browse the repository at this point in the history
…._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.
  • Loading branch information
Snuffleupagus committed Aug 13, 2020
1 parent e50cb4c commit d74dbde
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -939,8 +939,10 @@ const PDFViewerApplication = {
})
.catch(() => {
this.download();
}); // Error occurred, try downloading with the URL.
this._saveInProgress = false;
})
.finally(() => {
this._saveInProgress = false;
});
},

/**
Expand Down

0 comments on commit d74dbde

Please sign in to comment.