🎨 Adding row overwriting data after enabling sort in database Fix https://github.com/siyuan-note/siyuan/issues/9517

This commit is contained in:
Daniel 2023-10-26 19:57:25 +08:00
parent de9347fc97
commit 71dd27c62a
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -610,6 +610,11 @@ func (table *Table) SortRows() {
}
sort.Slice(table.Rows, func(i, j int) bool {
block := table.Rows[i].GetBlockValue()
if !block.IsInitialized && nil != block.Block && "" == block.Block.Content && block.IsDetached {
return false
}
for _, colIndexSort := range colIndexSorts {
result := table.Rows[i].Cells[colIndexSort.Index].Value.Compare(table.Rows[j].Cells[colIndexSort.Index].Value)
if 0 == result {