From 2994a9b1d7fc96ff70aaa98946883b50035772ef Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 22 Feb 2023 08:59:25 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=96=87=E6=A1=A3=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=90=8E=E6=96=87=E6=A1=A3=E6=A0=91=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E4=B8=8D=E6=AD=A3=E7=A1=AE=20https://github.com/siyua?= =?UTF-8?q?n-note/siyuan/issues/7435?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/heading.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/model/heading.go b/kernel/model/heading.go index 2e6762b88cd..458f034dd4f 100644 --- a/kernel/model/heading.go +++ b/kernel/model/heading.go @@ -224,10 +224,15 @@ func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath st contentPivot.Unlink() } - // 推送给前端移除旧文档 + box := Conf.Box(srcTree.Box) + if removeErr := box.Remove(srcTree.Path); nil != removeErr { + logging.LogWarnf("remove tree [%s] failed: %s", srcTree.Path, removeErr) + } + box.removeSort([]string{srcTree.ID}) + RemoveRecentDoc([]string{srcTree.ID}) evt := util.NewCmdResult("removeDoc", 0, util.PushModeBroadcast) evt.Data = map[string]interface{}{ - "ids": []string{srcTree.Root.ID}, + "ids": []string{srcTree.ID}, } util.PushEvent(evt)