🐛 Duplicated relation value https://github.com/siyuan-note/siyuan/issues/11251
This commit is contained in:
parent
0557a4232c
commit
d9a163515b
1 changed files with 5 additions and 2 deletions
|
@ -3166,6 +3166,9 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string,
|
|||
// 关联列得 content 是自动渲染的,所以不需要保存
|
||||
val.Relation.Contents = nil
|
||||
|
||||
// 去重
|
||||
val.Relation.BlockIDs = gulu.Str.RemoveDuplicatedElem(val.Relation.BlockIDs)
|
||||
|
||||
// 计算关联变更模式
|
||||
if len(oldRelationBlockIDs) == len(val.Relation.BlockIDs) {
|
||||
relationChangeMode = 0
|
||||
|
@ -3185,12 +3188,12 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string,
|
|||
// 将游离行绑定到新建的块上
|
||||
bindBlockAv(tx, avID, rowID)
|
||||
}
|
||||
} else { // 之前绑定了块
|
||||
} else { // 之前绑定了块
|
||||
if isUpdatingBlockKey { // 正在更新主键
|
||||
if val.IsDetached { // 现在是游离行
|
||||
// 将绑定的块从属性视图中移除
|
||||
unbindBlockAv(tx, avID, rowID)
|
||||
} else { // 现在绑定了块
|
||||
} else { // 现在绑定了块
|
||||
if oldBoundBlockID != val.BlockID { // 之前绑定的块和现在绑定的块不一样
|
||||
// 换绑块
|
||||
unbindBlockAv(tx, avID, oldBoundBlockID)
|
||||
|
|
Loading…
Add table
Reference in a new issue