mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
🎨 Fixed mirroring database display view https://github.com/siyuan-note/siyuan/issues/15279
This commit is contained in:
parent
09f5569663
commit
7a64af1e88
1 changed files with 20 additions and 0 deletions
|
|
@ -1283,6 +1283,26 @@ func (tx *Transaction) doUpdate(operation *Operation) (ret *TxErr) {
|
|||
|
||||
upsertAvBlockRel(updatedNode)
|
||||
|
||||
if ast.NodeAttributeView == updatedNode.Type {
|
||||
// 设置视图 https://github.com/siyuan-note/siyuan/issues/15279
|
||||
attrView, parseErr := av.ParseAttributeView(updatedNode.AttributeViewID)
|
||||
if nil == parseErr {
|
||||
v := attrView.GetView(attrView.ViewID)
|
||||
if nil != v {
|
||||
updatedNode.AttributeViewType = string(v.LayoutType)
|
||||
attrs := parse.IAL2Map(updatedNode.KramdownIAL)
|
||||
if "" == attrs[av.NodeAttrView] {
|
||||
attrs[av.NodeAttrView] = v.ID
|
||||
err = setNodeAttrs(updatedNode, tree, attrs)
|
||||
if err != nil {
|
||||
logging.LogWarnf("set node [%s] attrs failed: %s", operation.BlockID, err)
|
||||
return &TxErr{code: TxErrCodeBlockNotFound, id: id}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkUpsertInUserGuide(tree)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue