mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 11:30:42 +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.RemoveBoxHash(tx, box.ID)
|
||||||
sql.DeleteByBoxTx(tx, box.ID)
|
sql.DeleteByBoxTx(tx, box.ID)
|
||||||
sql.CommitTx(tx)
|
sql.CommitTx(tx)
|
||||||
treenode.RemoveBlockTreesByBoxID(box.ID)
|
ids := treenode.RemoveBlockTreesByBoxID(box.ID)
|
||||||
|
RemoveRecentDoc(ids)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (box *Box) ListFiles(path string) (ret []*FileInfo) {
|
func (box *Box) ListFiles(path string) (ret []*FileInfo) {
|
||||||
|
@ -175,11 +175,10 @@ func RemoveBlockTreesByPathPrefix(pathPrefix string) {
|
|||||||
blockTreesChanged = true
|
blockTreesChanged = true
|
||||||
}
|
}
|
||||||
|
|
||||||
func RemoveBlockTreesByBoxID(boxID string) {
|
func RemoveBlockTreesByBoxID(boxID string) (ids []string) {
|
||||||
blockTreesLock.Lock()
|
blockTreesLock.Lock()
|
||||||
defer blockTreesLock.Unlock()
|
defer blockTreesLock.Unlock()
|
||||||
|
|
||||||
var ids []string
|
|
||||||
for _, b := range blockTrees {
|
for _, b := range blockTrees {
|
||||||
if b.BoxID == boxID {
|
if b.BoxID == boxID {
|
||||||
ids = append(ids, b.ID)
|
ids = append(ids, b.ID)
|
||||||
@ -189,6 +188,7 @@ func RemoveBlockTreesByBoxID(boxID string) {
|
|||||||
delete(blockTrees, id)
|
delete(blockTrees, id)
|
||||||
}
|
}
|
||||||
blockTreesChanged = true
|
blockTreesChanged = true
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func RemoveBlockTree(id string) {
|
func RemoveBlockTree(id string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user