mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-28 09:54:07 +01:00
🎨 改进关闭笔记本体验 Fix https://github.com/siyuan-note/siyuan/issues/7124
This commit is contained in:
parent
74ef94875b
commit
7401ae845a
2 changed files with 8 additions and 4 deletions
|
|
@ -353,14 +353,18 @@ func (box *Box) Remove(path string) error {
|
|||
}
|
||||
|
||||
func (box *Box) Unindex() {
|
||||
task.PrependTask(task.DatabaseIndex, unindex, box.ID)
|
||||
}
|
||||
|
||||
func unindex(boxID string) {
|
||||
tx, err := sql.BeginTx()
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
sql.RemoveBoxHash(tx, box.ID)
|
||||
sql.DeleteByBoxTx(tx, box.ID)
|
||||
sql.RemoveBoxHash(tx, boxID)
|
||||
sql.DeleteByBoxTx(tx, boxID)
|
||||
sql.CommitTx(tx)
|
||||
ids := treenode.RemoveBlockTreesByBoxID(box.ID)
|
||||
ids := treenode.RemoveBlockTreesByBoxID(boxID)
|
||||
RemoveRecentDoc(ids)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue