1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 07:55:36 +00:00

optimization code

This commit is contained in:
zxj96
2019-06-18 21:35:39 +08:00
parent e357bf972b
commit 46aaf835e1
2 changed files with 9 additions and 14 deletions

View File

@@ -135,8 +135,7 @@ class TreeView extends React.Component {
if (dropNodeData.object.type === 'dir' && nodeDirent.type === 'dir') {
if (dropNodeData.parentNode.path !== nodeParentPath) {
let paths = Utils.getPaths(dropNodeData.path);
let isChildPath = paths.includes(nodeRootPath);
if (isChildPath) {
if (paths.includes(nodeRootPath)) {
return;
}
}
@@ -169,8 +168,7 @@ class TreeView extends React.Component {
// move dirents to one of their child. eg: A/B, A/D -> A/B/C
let isChildPath = direntPaths.some(direntPath => {
let flag = paths.includes(direntPath);
return flag;
return paths.includes(direntPath);
});
if (isChildPath) {
return;