🎨 Backlink count at the doc block title including sub-blocks https://github.com/siyuan-note/siyuan/issues/13791

This commit is contained in:
Daniel 2025-01-12 18:46:35 +08:00
parent c6e06b9f21
commit 34fa102296
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 83 additions and 40 deletions

View file

@ -128,7 +128,7 @@ func refreshProtyle(rootID string) {
}
// 刷新关联的嵌入块
refIDs, _ := sql.QueryRefIDsByDefID(rootID, true)
refIDs := sql.QueryRefIDsByDefID(rootID, true)
var rootIDs []string
bts := treenode.GetBlockTrees(refIDs)
for _, bt := range bts {
@ -154,11 +154,11 @@ func refreshRefCount(rootID, blockID string) {
isDoc := bt.ID == bt.RootID
var rootRefIDs []string
var refCount, rootRefCount int
refIDs, _ := sql.QueryRefIDsByDefID(bt.ID, isDoc)
refIDs := sql.QueryRefIDsByDefID(bt.ID, isDoc)
if isDoc {
rootRefIDs = refIDs
} else {
rootRefIDs, _ = sql.QueryRefIDsByDefID(bt.RootID, true)
rootRefIDs = sql.QueryRefIDsByDefID(bt.RootID, true)
}
refCount = len(refIDs)
rootRefCount = len(rootRefIDs)