mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🐛 聚焦后反链面板未跟随聚焦显示反链 Fix https://github.com/siyuan-note/insider/issues/1079
This commit is contained in:
parent
e32966d70b
commit
6afce77b1d
1 changed files with 3 additions and 1 deletions
|
|
@ -306,12 +306,13 @@ func GetBacklink2(id, keyword, mentionKeyword string) (boxID string, backlinks,
|
||||||
if nil == sqlBlock {
|
if nil == sqlBlock {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
rootID := sqlBlock.RootID
|
||||||
boxID = sqlBlock.Box
|
boxID = sqlBlock.Box
|
||||||
|
|
||||||
refs := sql.QueryRefsByDefID(id, true)
|
refs := sql.QueryRefsByDefID(id, true)
|
||||||
refs = removeDuplicatedRefs(refs) // 同一个块中引用多个相同块时反链去重 https://github.com/siyuan-note/siyuan/issues/3317
|
refs = removeDuplicatedRefs(refs) // 同一个块中引用多个相同块时反链去重 https://github.com/siyuan-note/siyuan/issues/3317
|
||||||
|
|
||||||
linkRefs, linkRefsCount, excludeBacklinkIDs := buildLinkRefs(id, refs)
|
linkRefs, linkRefsCount, excludeBacklinkIDs := buildLinkRefs(rootID, refs)
|
||||||
tmpBacklinks := toFlatTree(linkRefs, 0, "backlink")
|
tmpBacklinks := toFlatTree(linkRefs, 0, "backlink")
|
||||||
for _, l := range tmpBacklinks {
|
for _, l := range tmpBacklinks {
|
||||||
l.Blocks = nil
|
l.Blocks = nil
|
||||||
|
|
@ -461,6 +462,7 @@ func buildLinkRefs(defRootID string, refs []*sql.Ref) (ret []*Block, refsCount i
|
||||||
queryBlockIDs = append(queryBlockIDs, ref.DefBlockID)
|
queryBlockIDs = append(queryBlockIDs, ref.DefBlockID)
|
||||||
queryBlockIDs = append(queryBlockIDs, ref.BlockID)
|
queryBlockIDs = append(queryBlockIDs, ref.BlockID)
|
||||||
}
|
}
|
||||||
|
queryBlockIDs = gulu.Str.RemoveDuplicatedElem(queryBlockIDs)
|
||||||
querySQLBlocks := sql.GetBlocks(queryBlockIDs)
|
querySQLBlocks := sql.GetBlocks(queryBlockIDs)
|
||||||
defSQLBlocksCache := map[string]*sql.Block{}
|
defSQLBlocksCache := map[string]*sql.Block{}
|
||||||
for _, defSQLBlock := range querySQLBlocks {
|
for _, defSQLBlock := range querySQLBlocks {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue