mirror of
https://github.com/lil-org/tokenary.git
synced 2025-01-07 14:10:28 +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) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user