mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 15:38:15 +00:00
modify func name
This commit is contained in:
@@ -544,15 +544,15 @@ class LibContentView extends React.Component {
|
|||||||
let tree = this.state.treeData.clone();
|
let tree = this.state.treeData.clone();
|
||||||
let node = tree.getNodeByPath(path);
|
let node = tree.getNodeByPath(path);
|
||||||
|
|
||||||
let temporaryData = node.children.map(item => item.object);
|
let nodeChildren = node.children.map(item => item.object);
|
||||||
let beforeNames = temporaryData.map(item => item.name);
|
let nodeChildrenNames = nodeChildren.map(item => item.name);
|
||||||
|
|
||||||
seafileAPI.listDir(repoID, path).then(res => {
|
seafileAPI.listDir(repoID, path).then(res => {
|
||||||
let name = res.data.dirent_list;
|
let newDirentList = res.data.dirent_list;
|
||||||
let names = name.filter(item => {
|
let newAddedDirents = newDirentList.filter(item => {
|
||||||
return !beforeNames.includes(item.name)
|
return !nodeChildrenNames.includes(item.name)
|
||||||
})
|
})
|
||||||
names.map(item => {
|
newAddedDirents.map(item => {
|
||||||
this.addNodeToTree(item.name, path, item.type);
|
this.addNodeToTree(item.name, path, item.type);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user