From 71abe4057f4254f62203bbd194a524b5a913bf35 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Mon, 4 Mar 2024 14:31:44 +0800 Subject: [PATCH] :art: Database block support specified view https://github.com/siyuan-note/siyuan/issues/10443 --- kernel/model/attribute_view.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 893b30b6e..942ad365b 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -1343,6 +1343,7 @@ func (tx *Transaction) doRemoveAttrViewView(operation *Operation) (ret *TxErr) { } mirrorBlocks := av.GetMirrorBlockIDs(avID) + mirrorBlockTree := map[string]*parse.Tree{} trees := map[string]*parse.Tree{} for _, mirrorBlock := range mirrorBlocks { bt := treenode.GetBlockTree(mirrorBlock) @@ -1351,20 +1352,21 @@ func (tx *Transaction) doRemoveAttrViewView(operation *Operation) (ret *TxErr) { continue } - tree := trees[mirrorBlock] + tree := mirrorBlockTree[mirrorBlock] if nil == tree { tree, _ = loadTreeByBlockID(mirrorBlock) if nil == tree { logging.LogErrorf("load tree by block ID [%s] failed", mirrorBlock) continue } - trees[mirrorBlock] = tree + trees[tree.ID] = tree + mirrorBlockTree[mirrorBlock] = tree } } var nodes []*ast.Node for _, mirrorBlock := range mirrorBlocks { - tree := trees[mirrorBlock] + tree := mirrorBlockTree[mirrorBlock] node := treenode.GetNodeInTree(tree, mirrorBlock) if nil == node { logging.LogErrorf("get node in tree by block ID [%s] failed", mirrorBlock)