This commit is contained in:
Daniel 2025-06-16 21:07:45 +08:00
parent 8eb37bd735
commit 218bbe2000
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 38 additions and 8 deletions

View file

@ -53,25 +53,25 @@ func (tx *Transaction) doSetAttrViewBlockView(operation *Operation) (ret *TxErr)
}
func (tx *Transaction) doChangeAttrViewLayout(operation *Operation) (ret *TxErr) {
err := changeAttrViewLayout(operation)
err := ChangeAttrViewLayout(operation.BlockID, operation.AvID, operation.Layout)
if err != nil {
return &TxErr{code: TxErrWriteAttributeView, id: operation.AvID, msg: err.Error()}
}
return
}
func changeAttrViewLayout(operation *Operation) (err error) {
attrView, err := av.ParseAttributeView(operation.AvID)
func ChangeAttrViewLayout(blockID, avID string, layout av.LayoutType) (err error) {
attrView, err := av.ParseAttributeView(avID)
if err != nil {
return
}
view, err := getAttrViewViewByBlockID(attrView, operation.BlockID)
view, err := getAttrViewViewByBlockID(attrView, blockID)
if err != nil {
return
}
newLayout := operation.Layout
newLayout := layout
if newLayout == view.LayoutType {
return
}