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