🎨 The database-bound block is automatically added to the database after being copied as a replica https://github.com/siyuan-note/siyuan/issues/11959

This commit is contained in:
Daniel 2024-07-17 09:59:22 +08:00
parent 1645099945
commit 935efd7d3d
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -1036,6 +1036,16 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) {
upsertAvBlockRel(insertedNode)
// 复制为副本时将该副本块插入到数据库中 https://github.com/siyuan-note/siyuan/issues/11959
avs := insertedNode.IALAttr(av.NodeAttrNameAvs)
for _, avID := range strings.Split(avs, ",") {
AddAttributeViewBlock(tx, []map[string]interface{}{{
"id": insertedNode.ID,
"isDetached": false,
}}, avID, "", previousID, false)
util.PushReloadAttrView(avID)
}
operation.ID = insertedNode.ID
operation.ParentID = insertedNode.Parent.ID