This commit is contained in:
Daniel 2025-06-17 11:25:28 +08:00
parent f95d3b99bd
commit a0b7998401
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -119,6 +119,20 @@ func ChangeAttrViewLayout(blockID, avID string, layout av.LayoutType) (err error
view.LayoutType = newLayout
err = av.SaveAttributeView(attrView)
node, tree, err := getNodeByBlockID(nil, blockID)
if err != nil {
return
}
node.AttributeViewType = string(view.LayoutType)
attrs := parse.IAL2Map(node.KramdownIAL)
attrs[av.NodeAttrView] = view.ID
err = setNodeAttrs(node, tree, attrs)
if err != nil {
logging.LogWarnf("set node [%s] attrs failed: %s", blockID, err)
return
}
return
}
@ -469,7 +483,6 @@ func SetDatabaseBlockView(blockID, avID, viewID string) (err error) {
}
node.AttributeViewType = string(view.LayoutType)
attrs := parse.IAL2Map(node.KramdownIAL)
attrs[av.NodeAttrView] = viewID
err = setNodeAttrs(node, tree, attrs)