Fix review findings in file picker

This commit is contained in:
“Naeel”
2026-09-05 10:00:14 +03:00
parent 6fea5bce49
commit 8f775e34a9
6 changed files with 67 additions and 19 deletions
+7 -2
View File
@@ -1,5 +1,10 @@
import { flattenFiles } from './render.js';
export function setStatus(path, html, state, elements) {
const index = state.files.findIndex((file) => file.name === path);
const cell = elements.tableBodyEl.querySelector(`#st-${index}`);
const file = flattenFiles(state.nodes).find((item) => item.path === path);
if (!file) return;
const cell = Array.from(elements.tableBodyEl.querySelectorAll('.tree-row.tree-file'))
.find((row) => row.dataset.path === file.path)
?.querySelector('td:nth-child(3)');
if (cell) cell.innerHTML = html;
}