diff --git a/settings.html b/settings.html
index 8749f12..b475427 100644
--- a/settings.html
+++ b/settings.html
@@ -1009,15 +1009,20 @@
const aegisCheck = document.getElementById("aegisCheck");
const aegisApply = document.getElementById("aegisApply");
const isAegis = (a) => a && (a.id === "aegis" || a.id === "bchwallet");
+ // addons-list returns {installed:[...], sidebarPanels:[...]}
+ // addons-check-updates returns {report, skipped, staged:[...]}
+ // addons-list-staged returns a flat [...]. Normalise both call sites.
async function refreshAegis() {
aegisApply.hidden = true;
try {
- const [installed, staged] = await Promise.all([
- C.listAddons ? C.listAddons() : Promise.resolve([]),
+ const [listRes, stagedRes] = await Promise.all([
+ C.listAddons ? C.listAddons() : Promise.resolve({}),
C.listStagedAddonUpdates ? C.listStagedAddonUpdates() : Promise.resolve([]),
]);
- const cur = (installed || []).find(isAegis);
- const upd = (staged || []).find(isAegis);
+ const installed = (listRes && listRes.installed) || [];
+ const staged = Array.isArray(stagedRes) ? stagedRes : [];
+ const cur = installed.find(isAegis);
+ const upd = staged.find(isAegis);
if (!cur) { aegisStatus.textContent = "Aegis isn't installed. Reinstall Theseus to add it back, or open Settings > Extensions to load it manually."; return; }
const curVer = cur.version || "?";
if (upd && upd.version) {
@@ -1033,8 +1038,9 @@
aegisCheck.disabled = true; aegisCheck.textContent = "Checking…";
aegisStatus.textContent = "Checking…";
try {
- const staged = await (C.checkAddonUpdates ? C.checkAddonUpdates() : Promise.resolve([]));
- const upd = (staged || []).find(isAegis);
+ const res = await (C.checkAddonUpdates ? C.checkAddonUpdates() : Promise.resolve({}));
+ const staged = (res && Array.isArray(res.staged)) ? res.staged : [];
+ const upd = staged.find(isAegis);
if (!upd) { aegisStatus.textContent = "You're on the latest Aegis."; }
// refresh will populate everything else + toggle the Apply button
refreshAegis();