Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Fix https://github.com/siyuan-note/siyuan/issues/16493

Danielcb79c4aed6d5
diff --git a/kernel/model/file.go b/kernel/model/file.go
index 66d6826462..090984691d 100644
--- a/kernel/model/file.go
+++ b/kernel/model/file.go
@@ -978,12 +978,6 @@ func DuplicateDoc(tree *parse.Tree) {
previousPath := tree.Path
resetTree(tree, "Duplicated", false)
- createTreeTx(tree)
- box := Conf.Box(tree.Box)
- if nil != box {
- box.addSort(previousPath, tree.ID)
- }
- FlushTxQueue()
// 复制为副本时移除数据库绑定状态 https://github.com/siyuan-note/siyuan/issues/12294
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
@@ -996,6 +990,13 @@ func DuplicateDoc(tree *parse.Tree) {
n.RemoveIALAttrsByPrefix(av.NodeAttrViewStaticText)
return ast.WalkContinue
})
+
+ createTreeTx(tree)
+ box := Conf.Box(tree.Box)
+ if nil != box {
+ box.addSort(previousPath, tree.ID)
+ }
+ FlushTxQueue()
return
}