🐛 Fix multiple docs convert to headings https://github.com/siyuan-note/siyuan/issues/13225

This commit is contained in:
Daniel 2024-12-06 23:15:49 +08:00
parent 75b973d44c
commit d9155c27b6
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
13 changed files with 6 additions and 11 deletions

View file

@ -122,6 +122,8 @@ func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath st
return
}
FlushTxQueue()
srcTree, _ := LoadTreeByBlockID(srcID)
if nil == srcTree {
err = ErrBlockNotFound
@ -274,6 +276,8 @@ func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath st
}
func Heading2Doc(srcHeadingID, targetBoxID, targetPath, previousPath string) (srcRootBlockID, newTargetPath string, err error) {
FlushTxQueue()
srcTree, _ := LoadTreeByBlockID(srcHeadingID)
if nil == srcTree {
err = ErrBlockNotFound

View file

@ -28,6 +28,8 @@ import (
)
func ListItem2Doc(srcListItemID, targetBoxID, targetPath, previousPath string) (srcRootBlockID, newTargetPath string, err error) {
FlushTxQueue()
srcTree, _ := LoadTreeByBlockID(srcListItemID)
if nil == srcTree {
err = ErrBlockNotFound