Skip to content

Commit

Permalink
Web: Files: fixed upload to tree menu
Browse files Browse the repository at this point in the history
  • Loading branch information
gopienkonikita committed Nov 3, 2021
1 parent bc765df commit 94fbdfa
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions products/ASC.Files/Client/src/store/UploadDataStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,19 +463,22 @@ class UploadDataStore {
if (window.location.pathname.indexOf("/history") === -1) {
const newFiles = files;
const newFolders = folders;
const path = currentFile.path;

if (path[path.length - 1] !== this.selectedFolderStore.id) {
return;
}

let folderInfo = null;
const index = currentFile.path.findIndex(
(x) => x === this.selectedFolderStore.id
);
const folderId = currentFile.path[index + 1];
const index = path.findIndex((x) => x === this.selectedFolderStore.id);
const folderId = index !== -1 ? path[index + 1] : null;
if (folderId) folderInfo = await getFolderInfo(folderId);

const newPath = [];
if (folderInfo) {
let i = 0;
while (currentFile.path[i] && currentFile.path[i] !== folderId) {
newPath.push(currentFile.path[i]);
while (path[i] && path[i] !== folderId) {
newPath.push(path[i]);
i++;
}
}
Expand Down

0 comments on commit 94fbdfa

Please sign in to comment.