🎨 改进关闭笔记本体验 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)
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ const (
|
|||
CloudSync = "task.cloud.sync" // 数据同步
|
||||
RepoCheckout = "task.repo.checkout" // 从快照中检出
|
||||
DatabaseIndexFull = "task.database.index.full" // 重建索引
|
||||
DatabaseIndex = "task.database.index" // 数据库所以队列
|
||||
DatabaseIndex = "task.database.index" // 数据库索引队列
|
||||
DatabaseIndexFix = "task.database.index.fix" // 数据库索引订正
|
||||
OCRImage = "task.ocr.image" // 图片 OCR 提取文本
|
||||
HistoryGenerateDoc = "task.history.generateDoc" // 生成文件历史
|
||||
|
|
Loading…
Add table
Reference in a new issue