🐛 文档转换标题后文档树刷新不正确 https://github.com/siyuan-note/siyuan/issues/7435

This commit is contained in:
Liang Ding 2023-02-22 08:31:46 +08:00
parent c65a88db88
commit 685d47452d
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 7 additions and 4 deletions

View file

@ -224,6 +224,13 @@ func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath st
contentPivot.Unlink()
}
// 推送给前端移除旧文档
evt := util.NewCmdResult("removeDoc", 0, util.PushModeBroadcast)
evt.Data = map[string]interface{}{
"ids": []string{srcTree.Root.ID},
}
util.PushEvent(evt)
srcTreeBox, srcTreePath = srcTree.Box, srcTree.Path // 返回旧的文档块位置,前端后续会删除旧的文档块
targetTree.Root.SetIALAttr("updated", util.CurrentTimeSecondsStr())
err = indexWriteJSONQueue(targetTree)