Fix admin activity modal row lookup
Bind activity row click handlers to the rendered row object instead of refinding it by id and type. Also guard activitySummary against missing rows to avoid runtime crashes in the admin activity modal.
This commit is contained in:
parent
255d7c7eee
commit
a4c53fe09d
1 changed files with 4 additions and 2 deletions
|
|
@ -720,6 +720,7 @@ async function renderActivity() {
|
|||
}
|
||||
|
||||
function activitySummary(row) {
|
||||
if (!row) return "—";
|
||||
const sum = row.summary || {};
|
||||
if (row.type === "run") {
|
||||
const parts = [];
|
||||
|
|
@ -758,8 +759,9 @@ async function loadActivity() {
|
|||
</tbody>
|
||||
</table>
|
||||
`;
|
||||
document.getElementById("a-table").querySelectorAll("tr[data-id]").forEach((tr) => {
|
||||
tr.addEventListener("click", () => openActivityModal(tr.dataset.type, Number(tr.dataset.id), r.items.find(x => x.type === tr.dataset.type && x.id === Number(tr.dataset.id))));
|
||||
document.getElementById("a-table").querySelectorAll("tr[data-id]").forEach((tr, index) => {
|
||||
const row = r.items[index];
|
||||
tr.addEventListener("click", () => openActivityModal(tr.dataset.type, Number(tr.dataset.id), row));
|
||||
});
|
||||
|
||||
const totalPages = Math.max(1, Math.ceil(s.total / s.pageSize));
|
||||
|
|
|
|||
Loading…
Reference in a new issue