mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
🎨 Improve blocktree
This commit is contained in:
parent
a8b3f6cc25
commit
415607f6dd
3 changed files with 4 additions and 7 deletions
|
|
@ -1638,11 +1638,8 @@ func removeDoc(box *Box, p string, luteEngine *lute.Lute) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// 刷新文档关联的数据库 https://github.com/siyuan-note/siyuan/issues/11731
|
|
||||||
syncDelete2AttributeView(removeTree.Root)
|
syncDelete2AttributeView(removeTree.Root)
|
||||||
|
syncDelete2Block(removeTree.Root)
|
||||||
// 解绑数据库关联
|
|
||||||
removeAvBlockRel(removeTree.Root)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if existChildren {
|
if existChildren {
|
||||||
|
|
|
||||||
|
|
@ -798,11 +798,11 @@ func (tx *Transaction) doDelete(operation *Operation) (ret *TxErr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
syncDelete2AttributeView(node)
|
syncDelete2AttributeView(node)
|
||||||
removeAvBlockRel(node)
|
syncDelete2Block(node)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func removeAvBlockRel(node *ast.Node) {
|
func syncDelete2Block(node *ast.Node) {
|
||||||
var avIDs []string
|
var avIDs []string
|
||||||
ast.Walk(node, func(n *ast.Node, entering bool) ast.WalkStatus {
|
ast.Walk(node, func(n *ast.Node, entering bool) ast.WalkStatus {
|
||||||
if !entering {
|
if !entering {
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ func removeDatabaseFile() (err error) {
|
||||||
|
|
||||||
func GetBlockTreesByType(typ string) (ret []*BlockTree) {
|
func GetBlockTreesByType(typ string) (ret []*BlockTree) {
|
||||||
sqlStmt := "SELECT * FROM blocktrees WHERE type = ?"
|
sqlStmt := "SELECT * FROM blocktrees WHERE type = ?"
|
||||||
rows, err := db.Query(sqlStmt)
|
rows, err := db.Query(sqlStmt, typ)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
logging.LogErrorf("sql query [%s] failed: %s", sqlStmt, err)
|
logging.LogErrorf("sql query [%s] failed: %s", sqlStmt, err)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue