From 9315ac1cf803323d49ac9efbbd37af68f70838c8 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Mon, 4 Mar 2024 23:07:32 +0800 Subject: [PATCH] :art: Database block support specified view https://github.com/siyuan-note/siyuan/issues/10443 --- kernel/model/attribute_view.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 8bdf7cc27..77acae96b 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -1345,7 +1345,12 @@ func (tx *Transaction) doRemoveAttrViewView(operation *Operation) (ret *TxErr) { if 0 > index { index = 0 } + attrView.ViewID = attrView.Views[index].ID + if err = av.SaveAttributeView(attrView); nil != err { + logging.LogErrorf("save attribute view [%s] failed: %s", avID, err) + return &TxErr{code: TxErrCodeWriteTree, msg: err.Error(), id: avID} + } mirrorBlocks := av.GetMirrorBlockIDs(avID) mirrorBlockTree := map[string]*parse.Tree{} @@ -1399,11 +1404,6 @@ func (tx *Transaction) doRemoveAttrViewView(operation *Operation) (ret *TxErr) { return } } - - if err = av.SaveAttributeView(attrView); nil != err { - logging.LogErrorf("save attribute view [%s] failed: %s", avID, err) - return &TxErr{code: TxErrCodeWriteTree, msg: err.Error(), id: avID} - } return }