diff --git a/services/web/frontend/js/features/file-tree/contexts/file-tree-actionable.js b/services/web/frontend/js/features/file-tree/contexts/file-tree-actionable.js index 21ac84abd3..e4905c303f 100644 --- a/services/web/frontend/js/features/file-tree/contexts/file-tree-actionable.js +++ b/services/web/frontend/js/features/file-tree/contexts/file-tree-actionable.js @@ -248,10 +248,11 @@ export function useFileTreeActionable() { } function startUploadingDocOrFile() { - const selectedEntityId = Array.from(selectedEntityIds)[0] - const found = findInTreeOrThrow(fileTreeData, selectedEntityId) - const parentFolderId = - found.type === 'folder' ? found.entity._id : found.parentFolderId + const parentFolderId = getSelectedParentFolderId( + fileTreeData, + selectedEntityIds + ) + window.dispatchEvent( new CustomEvent('FileTreeReactBridge.openNewDocModal', { detail: {