mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
🐛 Database render deleted block https://ld246.com/article/1695790906050/comment/1696234209062?r=88250#comments
This commit is contained in:
parent
f6a8ca20cd
commit
c5a25fe88f
1 changed files with 23 additions and 2 deletions
|
|
@ -219,8 +219,19 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
|
||||||
|
|
||||||
// 过滤掉不存在的行
|
// 过滤掉不存在的行
|
||||||
var notFound []string
|
var notFound []string
|
||||||
for blockID, v := range rows {
|
for blockID, values := range rows {
|
||||||
if v[0].IsDetached {
|
blockValue := getBlockValue(values)
|
||||||
|
if nil == blockValue {
|
||||||
|
notFound = append(notFound, blockID)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if blockValue.IsDetached {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if nil != blockValue.Block && "" == blockValue.Block.ID {
|
||||||
|
notFound = append(notFound, blockID)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -291,6 +302,16 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getBlockValue(values []*av.Value) (ret *av.Value) {
|
||||||
|
for _, v := range values {
|
||||||
|
if av.KeyTypeBlock == v.Type {
|
||||||
|
ret = v
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func (tx *Transaction) doSetAttrViewName(operation *Operation) (ret *TxErr) {
|
func (tx *Transaction) doSetAttrViewName(operation *Operation) (ret *TxErr) {
|
||||||
err := setAttributeViewName(operation)
|
err := setAttributeViewName(operation)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue