aboutsummaryrefslogtreecommitdiff
path: root/html/install.js
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-02-09 18:29:49 +0100
committerWojtek Kosior <koszko@koszko.org>2022-02-09 18:29:49 +0100
commit3d6ffa57e8a901bd61c2d95fbb6d1ca16d811898 (patch)
tree71878aacd7dae3dab9150f3f34f8256f92c95480 /html/install.js
parent1c65dd5ca24052ccf9a92939eecd0966c9635c50 (diff)
downloadbrowser-extension-3d6ffa57e8a901bd61c2d95fbb6d1ca16d811898.tar.gz
browser-extension-3d6ffa57e8a901bd61c2d95fbb6d1ca16d811898.zip
make resource dependency specifier an object
Diffstat (limited to 'html/install.js')
-rw-r--r--html/install.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/html/install.js b/html/install.js
index 68033bc..df63626 100644
--- a/html/install.js
+++ b/html/install.js
@@ -211,15 +211,15 @@ function InstallView(tab_id, on_view_show, on_view_hide) {
delete response.json.api_schema_version;
delete response.json.api_schema_revision;
- const files = response.json.source_copyright
- .concat(item_type === "resource" ? response.json.scripts : []);
+ const scripts = item_type === "resource" && response.json.scripts;
+ const files = response.json.source_copyright.concat(scripts || []);
if (item_type === "mapping") {
- for (const res_ref of Object.values(response.json.payloads))
+ for (const res_ref of Object.values(response.json.payloads || {}))
process_item(work, "resource", res_ref.identifier);
} else {
- for (const res_id of (response.json.dependencies || []))
- process_item(work, "resource", res_id);
+ for (const res_ref of (response.json.dependencies || []))
+ process_item(work, "resource", res_ref.identifier);
}
/*