🎨 Automatically fill in the filter result value when adding rows in the database table view https://github.com/siyuan-note/siyuan/issues/9905

This commit is contained in:
Daniel 2023-12-18 22:25:29 +08:00
parent e10d403cce
commit fcd134ad2d
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 33 additions and 16 deletions

View file

@ -727,7 +727,7 @@ func (table *Table) FilterRows() {
rows := []*TableRow{}
for _, row := range table.Rows {
block := row.GetBlockValue()
if !block.IsInitialized && nil != block.Block && "" == block.Block.Content && block.IsDetached {
if block.NotAffectFilter() {
rows = append(rows, row)
continue
}

View file

@ -54,6 +54,10 @@ type Value struct {
Rollup *ValueRollup `json:"rollup,omitempty"`
}
func (value *Value) NotAffectFilter() bool {
return !value.IsInitialized && nil != value.Block && "" == value.Block.Content && value.IsDetached
}
func (value *Value) String() string {
switch value.Type {
case KeyTypeBlock: