Web: Files: fixed tree folders update
This commit is contained in:
parent
4a31b4a53c
commit
40525b2734
@ -87,11 +87,12 @@ class SectionBodyContent extends React.PureComponent {
|
||||
if (fileAction.type === FileAction.Create || fileAction.type === FileAction.Rename) {
|
||||
onLoading(true);
|
||||
fetchFiles(folderId, filter, store.dispatch).then(data => {
|
||||
const newItem = item.id === -1 ? null : item;
|
||||
if (!item.fileExst) {
|
||||
const path = data.selectedFolder.pathParts;
|
||||
const newTreeFolders = treeFolders;
|
||||
const folders = data.selectedFolder.folders;
|
||||
loopTreeFolders(path, newTreeFolders, folders, null, item);
|
||||
loopTreeFolders(path, newTreeFolders, folders, null, newItem);
|
||||
setTreeFolders(newTreeFolders);
|
||||
}
|
||||
}).finally(() => onLoading(false))
|
||||
|
@ -204,9 +204,6 @@ const addTreeFolder = (folders, newItems, foldersCount) => {
|
||||
}
|
||||
|
||||
export const loopTreeFolders = (path, item, folders, foldersCount, currentFolder) => {
|
||||
if (currentFolder && currentFolder.id === -1) {
|
||||
return;
|
||||
}
|
||||
const newPath = path;
|
||||
while (path.length !== 0) {
|
||||
const newItems = item.find((x) => x.id === path[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user