1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 17:33:18 +00:00

Solve the root library problem (#3228)

* Solve the root library problem

* Solve the problem of moving itself
This commit is contained in:
zxj96
2019-04-09 16:07:57 +08:00
committed by Daniel Pan
parent a7ad92b908
commit 8688620f5b

View File

@@ -92,8 +92,12 @@ class TreeView extends React.Component {
let dropNodeData = node;
if (!dropNodeData) {
if (nodeParentPath === '/') {
this.setState({isTreeViewDropTipShow: false});
return;
}
this.onItemMove(this.props.currentRepoInfo, nodeDirent, '/', nodeParentPath);
this.setState({isTreeViewDropTipShow: false})
this.setState({isTreeViewDropTipShow: false});
return;
}
@@ -101,6 +105,10 @@ class TreeView extends React.Component {
return;
}
if (nodeParentPath === dropNodeData.path) {
return;
}
// copy the dirent to itself. eg: A/B -> A/B
if (nodeParentPath === dropNodeData.parentNode.path) {
if (dropNodeData.object.name === nodeDirent.name) {