mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 Improve database primary key binding block https://github.com/siyuan-note/siyuan/issues/10945
This commit is contained in:
parent
12ee5d5c4d
commit
fc3263985b
6 changed files with 22 additions and 5 deletions
|
|
@ -2129,6 +2129,7 @@ func addAttributeViewBlock(avID, blockID, previousBlockID, addingBlockID string,
|
|||
blockValue.IsDetached = isDetached
|
||||
blockValue.Block.Content = content
|
||||
blockValue.UpdatedAt = now
|
||||
util.PushMsg(Conf.language(242), 3000)
|
||||
err = av.SaveAttributeView(attrView)
|
||||
}
|
||||
return
|
||||
|
|
@ -2869,6 +2870,17 @@ func replaceAttributeViewBlock(operation *Operation, tx *Transaction) (err error
|
|||
node, _, _ = getNodeByBlockID(tx, operation.NextID)
|
||||
}
|
||||
|
||||
// 检查是否已经存在绑定块
|
||||
// Improve database primary key binding block https://github.com/siyuan-note/siyuan/issues/10945
|
||||
for _, keyValues := range attrView.KeyValues {
|
||||
for _, value := range keyValues.Values {
|
||||
if value.BlockID == operation.NextID {
|
||||
util.PushMsg(Conf.language(242), 3000)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for _, keyValues := range attrView.KeyValues {
|
||||
for _, value := range keyValues.Values {
|
||||
if value.BlockID == operation.PreviousID {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue