Daniel 2025-06-28 11:04:54 +08:00
parent 97b32dd85d
commit 26524dfd15
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -148,12 +148,12 @@ func ChangeAttrViewLayout(blockID, avID string, layout av.LayoutType) (err error
} }
view.LayoutType = newLayout view.LayoutType = newLayout
err = av.SaveAttributeView(attrView)
blockIDs := treenode.GetMirrorAttrViewBlockIDs(avID) blockIDs := treenode.GetMirrorAttrViewBlockIDs(avID)
for _, blockID := range blockIDs { for _, bID := range blockIDs {
node, tree, err := getNodeByBlockID(nil, blockID) node, tree, _ := getNodeByBlockID(nil, bID)
if err != nil { if nil == node || nil == tree {
logging.LogErrorf("get node by block ID [%s] failed", bID)
continue continue
} }
@ -162,10 +162,16 @@ func ChangeAttrViewLayout(blockID, avID string, layout av.LayoutType) (err error
attrs[av.NodeAttrView] = view.ID attrs[av.NodeAttrView] = view.ID
err = setNodeAttrs(node, tree, attrs) err = setNodeAttrs(node, tree, attrs)
if err != nil { if err != nil {
logging.LogWarnf("set node [%s] attrs failed: %s", blockID, err) logging.LogWarnf("set node [%s] attrs failed: %s", bID, err)
return
} }
} }
if err = av.SaveAttributeView(attrView); nil != err {
logging.LogErrorf("save attribute view [%s] failed: %s", avID, err)
return
}
ReloadAttrView(avID) ReloadAttrView(avID)
return return
} }