fix: sort uniqueDirs to prevent duplicate folder creation on upload
All checks were successful
Automated Container Build / build-and-push (push) Successful in 38s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 38s
This commit is contained in:
parent
a71b8e024a
commit
0221e277a6
1 changed files with 2 additions and 1 deletions
|
|
@ -1095,7 +1095,8 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
||||||
if (path) uniqueDirs.add(currentPath === '.' ? path : `${currentPath}/${path}`);
|
if (path) uniqueDirs.add(currentPath === '.' ? path : `${currentPath}/${path}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const dir of Array.from(uniqueDirs)) {
|
const sortedDirs = Array.from(uniqueDirs).sort((a, b) => a.length - b.length);
|
||||||
|
for (const dir of sortedDirs) {
|
||||||
try { await api.createFolder(dir); } catch {}
|
try { await api.createFolder(dir); } catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue