mirror of
https://github.com/lil-org/tokenary.git
synced 2025-01-08 14:49:38 +03:00
Respond with array of latestConfigurations in background script
This commit is contained in:
parent
a6eef64f13
commit
db9db9b4f4
@ -24,13 +24,16 @@ var didReadLatestConfigurations = false;
|
|||||||
|
|
||||||
function respondWithLatestConfiguration(host, sendResponse) {
|
function respondWithLatestConfiguration(host, sendResponse) {
|
||||||
var response = {};
|
var response = {};
|
||||||
|
|
||||||
const latest = latestConfigurations[host];
|
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);
|
sendResponse(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user