🎨 Improve database field default filling https://github.com/siyuan-note/siyuan/issues/11966

This commit is contained in:
Daniel 2025-08-12 11:36:58 +08:00
parent 120b0c1e57
commit 1136c1c493
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 37 additions and 51 deletions

View file

@ -115,22 +115,10 @@ func getAttrViewAddingBlockDefaultValues(attrView *av.AttributeView, view, group
continue
}
var newValue *av.Value
switch keyValues.Key.Type {
case av.KeyTypeNumber:
newValue = filter.GetAffectValue(keyValues.Key, addingItemID)
if nil == newValue {
newValue = getNewValueByNearItem(nearItem, keyValues.Key, addingItemID)
}
default:
if nil != nearItem {
newValue = getNewValueByNearItem(nearItem, keyValues.Key, addingItemID)
} else {
newValue = filter.GetAffectValue(keyValues.Key, addingItemID)
}
newValue := filter.GetAffectValue(keyValues.Key, addingItemID)
if nil == newValue {
newValue = getNewValueByNearItem(nearItem, keyValues.Key, addingItemID)
}
if nil != newValue {
ret[keyValues.Key.ID] = newValue
}