Collapse folders and zips by default

This commit is contained in:
“Naeel”
2026-09-06 12:37:06 +03:00
parent 860cdd4214
commit 8316e19725
3 changed files with 52 additions and 4 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ export function onFolderChange(state, cfg, elements) {
if (!roots.has(rootName)) {
// Один root на выбранный каталог позволяет сохранить дерево целиком.
roots.set(rootName, { id: crypto.randomUUID(), kind: 'folder', name: rootName,
path: rootName, children: [], expanded: true });
path: rootName, children: [], expanded: false });
}
const root = roots.get(rootName);
// Вставляет узел по его пути, создавая отсутствующие промежуточные папки.
@@ -44,7 +44,7 @@ export function onFolderChange(state, cfg, elements) {
if (!child) {
child = last ? node : { id: crypto.randomUUID(), kind: 'folder', name: part,
path: `${rootName}/${nodeParts.slice(0, index + 1).join('/')}`,
children: [], expanded: true };
children: [], expanded: false };
current.children.push(child);
}
current = child;