mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 03:21:21 +08:00
🎨 支持列出和切换最近打开的文档 https://github.com/siyuan-note/siyuan/issues/3293
This commit is contained in:
parent
72419c9075
commit
bcf3422080
@ -350,7 +350,8 @@ func (box *Box) Unindex() {
|
||||
sql.RemoveBoxHash(tx, box.ID)
|
||||
sql.DeleteByBoxTx(tx, box.ID)
|
||||
sql.CommitTx(tx)
|
||||
treenode.RemoveBlockTreesByBoxID(box.ID)
|
||||
ids := treenode.RemoveBlockTreesByBoxID(box.ID)
|
||||
RemoveRecentDoc(ids)
|
||||
}
|
||||
|
||||
func (box *Box) ListFiles(path string) (ret []*FileInfo) {
|
||||
|
@ -175,11 +175,10 @@ func RemoveBlockTreesByPathPrefix(pathPrefix string) {
|
||||
blockTreesChanged = true
|
||||
}
|
||||
|
||||
func RemoveBlockTreesByBoxID(boxID string) {
|
||||
func RemoveBlockTreesByBoxID(boxID string) (ids []string) {
|
||||
blockTreesLock.Lock()
|
||||
defer blockTreesLock.Unlock()
|
||||
|
||||
var ids []string
|
||||
for _, b := range blockTrees {
|
||||
if b.BoxID == boxID {
|
||||
ids = append(ids, b.ID)
|
||||
@ -189,6 +188,7 @@ func RemoveBlockTreesByBoxID(boxID string) {
|
||||
delete(blockTrees, id)
|
||||
}
|
||||
blockTreesChanged = true
|
||||
return
|
||||
}
|
||||
|
||||
func RemoveBlockTree(id string) {
|
||||
|
Loading…
Reference in New Issue
Block a user