mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 11:58:49 +01:00
🎨 Improve database field default filling https://github.com/siyuan-note/siyuan/issues/11966
This commit is contained in:
parent
120b0c1e57
commit
1136c1c493
2 changed files with 37 additions and 51 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue