mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-27 18:56:09 +01:00
🐛 Fix sort av view not working
This commit is contained in:
parent
667aa38d42
commit
cc9aed6aec
1 changed files with 4 additions and 5 deletions
|
|
@ -1376,15 +1376,14 @@ func (tx *Transaction) doSortAttrViewView(operation *Operation) (ret *TxErr) {
|
|||
return &TxErr{code: TxErrWriteAttributeView, id: operation.AvID, msg: err.Error()}
|
||||
}
|
||||
|
||||
view, err := getAttrViewViewByBlockID(attrView, operation.BlockID)
|
||||
view := attrView.GetView(operation.ID)
|
||||
if nil == view {
|
||||
logging.LogErrorf("get view failed: %s", operation.BlockID)
|
||||
return &TxErr{code: TxErrWriteAttributeView, id: operation.AvID, msg: err.Error()}
|
||||
}
|
||||
viewID := view.ID
|
||||
previewViewID := operation.PreviousID
|
||||
|
||||
if viewID == previewViewID {
|
||||
previousViewID := operation.PreviousID
|
||||
if viewID == previousViewID {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -1402,7 +1401,7 @@ func (tx *Transaction) doSortAttrViewView(operation *Operation) (ret *TxErr) {
|
|||
|
||||
attrView.Views = append(attrView.Views[:index], attrView.Views[index+1:]...)
|
||||
for i, v := range attrView.Views {
|
||||
if v.ID == previewViewID {
|
||||
if v.ID == previousViewID {
|
||||
previousIndex = i + 1
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue