Fix file picker extension filtering

This commit is contained in:
“Naeel”
2026-09-05 09:55:44 +03:00
parent a965f181d9
commit 6fea5bce49
6 changed files with 95 additions and 17 deletions
+5 -5
View File
@@ -41,12 +41,12 @@ export function onFolderChange(state, cfg, elements) {
if (lowerPath.endsWith('.zip')) {
try {
const zip = await listZipFiles(file, cfg.allowedExt);
rebaseTree(zip, rootName);
addToFolder(zip);
if (zip) {
rebaseTree(zip, rootName);
addToFolder(zip);
}
} catch (error) {
addToFolder({ id: crypto.randomUUID(), kind: 'zip', name: parts.at(-1),
path: relativePath, file, children: [], expanded: true,
error: 'Не удалось раскрыть ZIP' });
continue;
}
} else if (cfg.allowedExt.some((extension) => lowerPath.endsWith(extension))) {
addToFolder({ id: crypto.randomUUID(), kind: 'file', name: parts.at(-1),