From e12ed21c655e559cd7af5aa3ef507dba9c708fbd Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 2 Apr 2024 20:13:39 +0800 Subject: [PATCH] :bug: Improve outline dnd https://github.com/siyuan-note/siyuan/issues/10828 --- kernel/model/outline.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/kernel/model/outline.go b/kernel/model/outline.go index 25abe2b54..859287edc 100644 --- a/kernel/model/outline.go +++ b/kernel/model/outline.go @@ -31,17 +31,16 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) { previousID := operation.PreviousID parentID := operation.ParentID - if headingID == parentID || headingID == previousID { - return - } - tree, err := tx.loadTree(headingID) if nil != err { return &TxErr{code: TxErrCodeBlockNotFound, id: headingID} } - operation.RetData = tree.Root.ID + if headingID == parentID || headingID == previousID { + return + } + heading := treenode.GetNodeInTree(tree, headingID) if nil == heading { return &TxErr{code: TxErrCodeBlockNotFound, id: headingID}