mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 The database primary key field displays the icon of the bound doc https://github.com/siyuan-note/siyuan/issues/13378
This commit is contained in:
parent
dbdf3c15a9
commit
807f0df86f
4 changed files with 16 additions and 12 deletions
|
|
@ -1980,8 +1980,9 @@ func addAttributeViewBlock(now int64, avID, blockID, previousBlockID, addingBloc
|
|||
return
|
||||
}
|
||||
|
||||
var blockIcon string
|
||||
if !isDetached {
|
||||
addingBlockContent = getNodeAvBlockText(node)
|
||||
blockIcon, addingBlockContent = getNodeAvBlockText(node)
|
||||
}
|
||||
|
||||
// 检查是否重复添加相同的块
|
||||
|
|
@ -1992,6 +1993,7 @@ func addAttributeViewBlock(now int64, avID, blockID, previousBlockID, addingBloc
|
|||
// 重复绑定一下,比如剪切数据库块、取消绑定块后再次添加的场景需要
|
||||
bindBlockAv0(tx, avID, node, tree)
|
||||
blockValue.IsDetached = isDetached
|
||||
blockValue.Block.Icon = blockIcon
|
||||
blockValue.Block.Content = addingBlockContent
|
||||
blockValue.UpdatedAt = now
|
||||
err = av.SaveAttributeView(attrView)
|
||||
|
|
@ -2936,7 +2938,7 @@ func replaceAttributeViewBlock(operation *Operation, tx *Transaction) (err error
|
|||
if !operation.IsDetached {
|
||||
bindBlockAv0(tx, operation.AvID, node, tree)
|
||||
value.IsDetached = false
|
||||
value.Block.Content = getNodeAvBlockText(node)
|
||||
value.Block.Icon, value.Block.Content = getNodeAvBlockText(node)
|
||||
value.UpdatedAt = now
|
||||
err = av.SaveAttributeView(attrView)
|
||||
}
|
||||
|
|
@ -2973,7 +2975,7 @@ func replaceAttributeViewBlock(operation *Operation, tx *Transaction) (err error
|
|||
value.Block.ID = operation.NextID
|
||||
value.IsDetached = operation.IsDetached
|
||||
if !operation.IsDetached {
|
||||
value.Block.Content = getNodeAvBlockText(node)
|
||||
value.Block.Icon, value.Block.Content = getNodeAvBlockText(node)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue