🎨 Clean code
This commit is contained in:
parent
b042355363
commit
abf92b602c
1 changed files with 9 additions and 3 deletions
|
@ -3235,17 +3235,23 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string,
|
|||
|
||||
// val.IsDetached 只有更新主键的时候才会传入,所以下面需要结合 isUpdatingBlockKey 来判断
|
||||
|
||||
if oldIsDetached { // 之前是游离行
|
||||
if oldIsDetached {
|
||||
// 之前是游离行
|
||||
|
||||
if !val.IsDetached { // 现在绑定了块
|
||||
// 将游离行绑定到新建的块上
|
||||
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