Skip to content

Commit

Permalink
🎨 The database-bound block is automatically added to the database aft…
Browse files Browse the repository at this point in the history
…er being copied as a replica #11959
  • Loading branch information
88250 committed Jul 17, 2024
1 parent 1645099 commit 935efd7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kernel/model/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 935efd7

Please sign in to comment.