From cb79c4aed6d5485dcadc7251ef2b714d4edc84cf Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 4 Dec 2025 11:33:24 +0800 Subject: [PATCH] :bug: Fix https://github.com/siyuan-note/siyuan/issues/16493 Signed-off-by: Daniel <845765@qq.com> --- kernel/model/file.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/kernel/model/file.go b/kernel/model/file.go index 66d682646..090984691 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 }