🎨 Improve duplicating for a doc with databases https://github.com/siyuan-note/siyuan/issues/11602

This commit is contained in:
Daniel 2024-06-16 11:08:21 +08:00
parent 2589b009eb
commit 2a47791b4d
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 27 additions and 3 deletions

View file

@ -1640,13 +1640,19 @@ func removeDoc(box *Box, p string, luteEngine *lute.Lute) {
}
indexHistoryDir(filepath.Base(historyDir), util.NewLute())
// 刷新文档关联的数据库 https://github.com/siyuan-note/siyuan/issues/11731
allRemoveRootIDs := []string{tree.ID}
allRemoveRootIDs = append(allRemoveRootIDs, removeIDs...)
for _, rootID := range allRemoveRootIDs {
if removeTree, _ := LoadTreeByBlockID(rootID); nil != removeTree {
syncDelete2AttributeView(removeTree.Root)
removeTree, _ := LoadTreeByBlockID(rootID)
if nil == removeTree {
continue
}
// 刷新文档关联的数据库 https://github.com/siyuan-note/siyuan/issues/11731
syncDelete2AttributeView(removeTree.Root)
// 解绑数据库关联
removeAvBlockRel(removeTree.Root)
}
if existChildren {