mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-02 10:50:15 +01:00
This commit is contained in:
parent
734114e052
commit
4dd1a97262
1 changed files with 13 additions and 0 deletions
|
|
@ -529,6 +529,19 @@ func (tx *Transaction) removeAttributeViewBlock(operation *Operation) (err error
|
|||
}
|
||||
delete(attrs, NodeAttrNamePrefixAvKey+operation.AvID+"-"+values.KeyID)
|
||||
node.RemoveIALAttr(NodeAttrNamePrefixAvKey + operation.AvID + "-" + values.KeyID)
|
||||
|
||||
if avs := attrs[NodeAttrNameAvs]; "" != avs {
|
||||
avIDs := strings.Split(avs, ",")
|
||||
avIDs = gulu.Str.RemoveElem(avIDs, operation.AvID)
|
||||
if 0 == len(avIDs) {
|
||||
delete(attrs, NodeAttrNameAvs)
|
||||
node.RemoveIALAttr(NodeAttrNameAvs)
|
||||
} else {
|
||||
attrs[NodeAttrNameAvs] = strings.Join(avIDs, ",")
|
||||
node.SetIALAttr(NodeAttrNameAvs, strings.Join(avIDs, ","))
|
||||
}
|
||||
}
|
||||
|
||||
if err = setNodeAttrsWithTx(tx, node, tree, attrs); nil != err {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue