Skip to content

Commit

Permalink
fix: upload overlay breaking with nested folders
Browse files Browse the repository at this point in the history
Fixes an issue where the upload overlay breaks when uploading a folder that contains exactly one folder (which then contains some files).

The top level folder did not have an upload id in such case, hence the overlay could not retrieve the correct information.
  • Loading branch information
JammingBen committed Jul 30, 2024
1 parent f230f64 commit dd5b4c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-upload-nested-folders
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Uploading nested folders

We've fixed a bug where the upload overlay breaks when uploading a folder that contains exactly one folder (which then contains some files).

https://github.com/owncloud/web/issues/11299
https://github.com/owncloud/web/pull/11302
5 changes: 2 additions & 3 deletions packages/web-app-files/src/HandleUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,8 @@ export class HandleUpload extends BasePlugin {
for (const file of filesToUpload.filter(({ meta }) => !!meta.relativeFolder)) {
const folders = file.meta.relativeFolder.split('/').filter(Boolean)
let current = directoryTree
if (folders.length <= 1) {
topLevelIds[file.meta.relativeFolder] = file.meta.topLevelFolderId
}
// first folder is always top level
topLevelIds[urlJoin(folders[0])] = file.meta.topLevelFolderId
for (const folder of folders) {
current[folder] = current[folder] || {}
current = current[folder]
Expand Down

0 comments on commit dd5b4c5

Please sign in to comment.