Merge pull request #12285 from Snuffleupagus/sourceEventType-optional

Ensure that the `sourceEventType` parameter is actually optional in `PDFViewerApplication.{download, save}` (PR 12248 follow-up)
This commit is contained in:
Tim van der Meij 2020-08-26 22:18:19 +02:00 committed by GitHub
commit 3e437ce63c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -874,7 +874,7 @@ const PDFViewerApplication = {
);
},
download({ sourceEventType = "download" }) {
download({ sourceEventType = "download" } = {}) {
function downloadByUrl() {
downloadManager.downloadUrl(url, filename);
}
@ -907,7 +907,7 @@ const PDFViewerApplication = {
.catch(downloadByUrl); // Error occurred, try downloading with the URL.
},
save({ sourceEventType = "download" }) {
save({ sourceEventType = "download" } = {}) {
if (this._saveInProgress) {
return;
}
@ -988,7 +988,7 @@ const PDFViewerApplication = {
if (!download) {
return;
}
PDFViewerApplication.download();
PDFViewerApplication.download({ sourceEventType: "download" });
}
);
},