Improve recent docs loading performance Fix https://github.com/siyuan-note/siyuan/issues/11977

This commit is contained in:
Daniel 2024-07-14 22:16:11 +08:00
parent c79b56aef0
commit d6fba4d279
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -140,9 +140,14 @@ func getRecentDocs() (ret []*RecentDoc, err error) {
return
}
var rootIDs []string
for _, doc := range tmp {
rootIDs = append(rootIDs, doc.RootID)
}
bts := treenode.GetBlockTrees(rootIDs)
var notExists []string
for _, doc := range tmp {
if bt := treenode.GetBlockTree(doc.RootID); nil != bt {
if bt := bts[doc.RootID]; nil != bt {
doc.Title = path.Base(bt.HPath) // Recent docs not updated after renaming https://github.com/siyuan-note/siyuan/issues/7827
ret = append(ret, doc)
} else {