Skip to content

🎥 Make videos programmatically with React

Nested Folders fix

Patric Salvisbergcbd5884f4833
diff --git a/packages/cli/src/editor/components/CompositionSelector.tsx b/packages/cli/src/editor/components/CompositionSelector.tsx
index 682ee31acc..da680be2f1 100644
--- a/packages/cli/src/editor/components/CompositionSelector.tsx
+++ b/packages/cli/src/editor/components/CompositionSelector.tsx
@@ -107,12 +107,17 @@ export const CompositionSelector: React.FC = () => {
let currentParentName: string | null = parentFolderName;
while (currentFolder) {
+ if (currentParentName?.includes('/')) {
+ const splittedParentName = currentParentName.split('/');
+ currentParentName = splittedParentName.pop() ?? null;
+ }
+
const key = openFolderKey(currentFolder, currentParentName);
foldersExpandedState[key] = true;
- const parentFolder = folders.find(
- (f) => f.name === currentParentName && currentParentName
- );
+ const parentFolder = folders.find((f) => {
+ return f.name === currentParentName && currentParentName;
+ });
currentFolder = parentFolder?.name ?? null;
currentParentName = parentFolder?.parent ?? null;
}