mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Improve av https://github.com/siyuan-note/siyuan/issues/15489
This commit is contained in:
parent
207eb6b086
commit
97684b411a
1 changed files with 15 additions and 11 deletions
|
@ -4310,20 +4310,24 @@ func updateAttributeViewValue(tx *Transaction, attrView *av.AttributeView, keyID
|
|||
|
||||
// val.IsDetached 只有更新主键的时候才会传入,所以下面需要结合 isUpdatingBlockKey 来判断
|
||||
|
||||
if oldIsDetached {
|
||||
// 之前是游离行
|
||||
if isUpdatingBlockKey {
|
||||
if oldIsDetached {
|
||||
// 之前是游离行
|
||||
|
||||
if !val.IsDetached { // 现在绑定了块
|
||||
// 将游离行绑定到新建的块上
|
||||
bindBlockAv(tx, avID, blockID)
|
||||
if nil != val.Block {
|
||||
val.BlockID = val.Block.ID
|
||||
if !val.IsDetached { // 现在绑定了块
|
||||
// 将游离行绑定到新建的块上
|
||||
|
||||
if val.Block.ID != blockID {
|
||||
// 从其他库拷贝主键值后会出现该情况
|
||||
blockID = val.Block.ID
|
||||
val.BlockID = blockID
|
||||
}
|
||||
|
||||
bindBlockAv(tx, avID, blockID)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 之前绑定了块
|
||||
} else {
|
||||
// 之前绑定了块
|
||||
|
||||
if isUpdatingBlockKey { // 正在更新主键
|
||||
if val.IsDetached { // 现在是游离行
|
||||
// 将绑定的块从属性视图中移除
|
||||
unbindBlockAv(tx, avID, blockID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue