mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-29 21:08:49 +01:00
🎨 Supports multiple views for the database https://github.com/siyuan-note/siyuan/issues/9751
This commit is contained in:
parent
f5fdab844e
commit
4d5071c31d
1 changed files with 5 additions and 0 deletions
|
|
@ -643,6 +643,10 @@ func (tx *Transaction) doRemoveAttrViewView(operation *Operation) (ret *TxErr) {
|
|||
return &TxErr{code: TxErrCodeBlockNotFound, id: avID}
|
||||
}
|
||||
|
||||
if 1 >= len(attrView.Views) {
|
||||
return
|
||||
}
|
||||
|
||||
viewID := operation.ID
|
||||
for i, view := range attrView.Views {
|
||||
if viewID == view.ID {
|
||||
|
|
@ -651,6 +655,7 @@ func (tx *Transaction) doRemoveAttrViewView(operation *Operation) (ret *TxErr) {
|
|||
}
|
||||
}
|
||||
|
||||
attrView.ViewID = attrView.Views[0].ID
|
||||
if err = av.SaveAttributeView(attrView); nil != err {
|
||||
logging.LogErrorf("save attribute view [%s] failed: %s", avID, err)
|
||||
return &TxErr{code: TxErrCodeWriteTree, msg: err.Error(), id: avID}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue