🎨 Support modifying the primary key value of the binding block https://github.com/siyuan-note/siyuan/issues/9892

This commit is contained in:
Daniel 2023-12-18 12:35:48 +08:00
parent 5d493e207a
commit 2b201abb80
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -1710,12 +1710,6 @@ func replaceAttributeViewBlock(operation *Operation, tx *Transaction) (err error
for _, v := range attrView.Views {
switch v.LayoutType {
case av.LayoutTypeTable:
for _, rowID := range v.Table.RowIDs {
if rowID == operation.NextID {
return
}
}
for i, rowID := range v.Table.RowIDs {
if rowID == operation.PreviousID {
v.Table.RowIDs[i] = operation.NextID
@ -1800,7 +1794,10 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string,
unbindBlockAv(tx, avID, oldBoundBlockID)
bindBlockAv(tx, avID, val.BlockID)
} else { // 之前绑定的块和现在绑定的块一样
// 直接返回,因为锚文本不允许更改
if av.KeyTypeBlock == val.Type && nil != val.Block {
// 直接返回,因为锚文本不允许更改
return
}
}
}
}
@ -1811,6 +1808,7 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string,
if rowID == v.Block.ID {
v.Block.Updated = time.Now().UnixMilli()
v.IsInitialized = true
v.IsDetached = val.IsDetached
break
}
}