Merge pull request #12800 from Snuffleupagus/DefaultExternalServices-async-fallback
Convert `DefaultExternalServices.fallback` to an asynchronous method
This commit is contained in:
commit
f305e042ee
15
web/app.js
15
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" });
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user