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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user