diff --git a/web/app.js b/web/app.js index 098488e83..ace56420e 100644 --- a/web/app.js +++ b/web/app.js @@ -150,7 +150,7 @@ class DefaultExternalServices { static initPassiveLoading(callbacks) {} - static fallback(data, callback) {} + static async fallback(data) {} static reportTelemetry(data) {} @@ -1102,18 +1102,17 @@ const PDFViewerApplication = { return; } this.fellback = true; - this.externalServices.fallback( - { + this.externalServices + .fallback({ featureId, url: this.baseUrl, - }, - function response(download) { + }) + .then(download => { if (!download) { return; } - PDFViewerApplication.download({ sourceEventType: "download" }); - } - ); + this.download({ sourceEventType: "download" }); + }); }, /** diff --git a/web/firefoxcom.js b/web/firefoxcom.js index 30b9ed791..da61ebb6e 100644 --- a/web/firefoxcom.js +++ b/web/firefoxcom.js @@ -344,8 +344,10 @@ class FirefoxExternalServices extends DefaultExternalServices { FirefoxCom.requestSync("initPassiveLoading", null); } - static fallback(data, callback) { - FirefoxCom.request("fallback", data, callback); + static async fallback(data) { + return new Promise(resolve => { + FirefoxCom.request("fallback", data, resolve); + }); } static reportTelemetry(data) {