Merge pull request #3485 from overleaf/ta-file-tree-upload-fix

[ReactFileTree] Fix Upload Button When No Entities Are Selected

GitOrigin-RevId: d7438ccee741c21190deaddc376c6f394870de42
This commit is contained in:
Timothée Alby 2021-01-05 11:58:03 +01:00 committed by Copybot
parent 16a715c816
commit d8469953f1

View file

@ -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: {