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
+6 -4
View File
@@ -44,16 +44,18 @@ async function listEntries(data, zipName, allowedExt, depth) {
if (entryName.endsWith('/')) continue;
if (entryName.toLowerCase().endsWith('.zip')) {
const nested = await listEntries(entryData, entryName, allowedExt, depth + 1);
rebaseTree(nested, zipName);
nested.name = entryName.split('/').pop();
addPath(root, entryName.split('/'), nested);
if (nested) {
rebaseTree(nested, zipName);
nested.name = entryName.split('/').pop();
addPath(root, entryName.split('/'), nested);
}
} else if (extensionAllowed(entryName, allowedExt)) {
const path = `${zipName}/${entryName}`;
const file = makeFile(entryData, path);
addPath(root, entryName.split('/'), node('file', entryName.split('/').pop(), path, [], file));
}
}
return root;
return root.children.length ? root : null;
}
export async function listZipFiles(file, allowedExt) {