Fix review findings in file picker
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user