Respond with array of latestConfigurations in background script

This commit is contained in:
Ivan Grachev 2022-07-12 18:33:28 +03:00
parent a6eef64f13
commit db9db9b4f4

View File

@ -24,13 +24,16 @@ var didReadLatestConfigurations = false;
function respondWithLatestConfiguration(host, sendResponse) {
var response = {};
const latest = latestConfigurations[host];
if (typeof latest !== "undefined") {
response = latest;
if (Array.isArray(latest)) {
response.latestConfigurations = latest;
} else if (typeof latest !== "undefined" && "provider" in latest) {
response.latestConfigurations = [latest];
} else {
response.latestConfigurations = [];
}
response.name = "didLoadLatestConfiguration";
sendResponse(response);
}