mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 22:01:06 +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;
|
let dropNodeData = node;
|
||||||
|
|
||||||
if (!dropNodeData) {
|
if (!dropNodeData) {
|
||||||
|
if (nodeParentPath === '/') {
|
||||||
|
this.setState({isTreeViewDropTipShow: false});
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.onItemMove(this.props.currentRepoInfo, nodeDirent, '/', nodeParentPath);
|
this.onItemMove(this.props.currentRepoInfo, nodeDirent, '/', nodeParentPath);
|
||||||
this.setState({isTreeViewDropTipShow: false})
|
this.setState({isTreeViewDropTipShow: false});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,6 +105,10 @@ class TreeView extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nodeParentPath === dropNodeData.path) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// copy the dirent to itself. eg: A/B -> A/B
|
// copy the dirent to itself. eg: A/B -> A/B
|
||||||
if (nodeParentPath === dropNodeData.parentNode.path) {
|
if (nodeParentPath === dropNodeData.parentNode.path) {
|
||||||
if (dropNodeData.object.name === nodeDirent.name) {
|
if (dropNodeData.object.name === nodeDirent.name) {
|
||||||
|
Reference in New Issue
Block a user