This commit is contained in:
2026-01-18 15:53:03 +00:00
parent 857b7a127a
commit cffb0af60e

View File

@@ -389,10 +389,29 @@ class BahmcloudStorePanel extends HTMLElement {
} }
this._update(); this._update();
this._loadRepoDetails(repoId);
this._loadReadme(repoId); this._loadReadme(repoId);
this._loadVersions(repoId); this._loadVersions(repoId);
} }
async _loadRepoDetails(repoId) {
if (!this._hass || !repoId) return;
try {
const resp = await this._hass.callApi("get", `bcs/repo?repo_id=${encodeURIComponent(repoId)}`);
if (resp?.ok && resp.repo) {
this._detailRepo = resp.repo;
// Also update the cached list item if present
const repos = Array.isArray(this._data?.repos) ? this._data.repos : [];
const idx = repos.findIndex((r) => this._safeId(r?.id) === repoId);
if (idx >= 0) repos[idx] = resp.repo;
this._update();
}
} catch (e) {
// ignore: details are optional
}
}
async _loadVersions(repoId) { async _loadVersions(repoId) {
if (!this._hass) return; if (!this._hass) return;
if (!repoId) return; if (!repoId) return;