mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-02 02:40:15 +01:00
🎨 Improve move doc
This commit is contained in:
parent
a00d42b286
commit
84c801bbc9
1 changed files with 10 additions and 0 deletions
|
|
@ -1238,6 +1238,16 @@ func MoveDocs(fromPaths []string, toBoxID, toPath string, callback interface{})
|
|||
|
||||
pathsBoxes := getBoxesByPaths(fromPaths)
|
||||
|
||||
if 1 == len(fromPaths) {
|
||||
// 移动到自己的父文档下的情况相当于不移动,直接返回
|
||||
if fromBox := pathsBoxes[fromPaths[0]]; nil != fromBox && fromBox.ID == toBoxID {
|
||||
parentDir := path.Dir(fromPaths[0])
|
||||
if ("/" == toPath && "/" == parentDir) || (parentDir+".sy" == toPath) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 检查路径深度是否超过限制
|
||||
for fromPath, fromBox := range pathsBoxes {
|
||||
childDepth := util.GetChildDocDepth(filepath.Join(util.DataDir, fromBox.ID, fromPath))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue