Browse Source

:bug: Recent docs not updated after renaming Fix https://github.com/siyuan-note/siyuan/issues/7827

Liang Ding 2 years ago
parent
commit
79f262a27e
1 changed files with 3 additions and 1 deletions
  1. 3 1
      kernel/model/storage.go

+ 3 - 1
kernel/model/storage.go

@@ -19,6 +19,7 @@ package model
 import (
 import (
 	"errors"
 	"errors"
 	"os"
 	"os"
+	"path"
 	"path/filepath"
 	"path/filepath"
 	"sync"
 	"sync"
 
 
@@ -145,7 +146,8 @@ func getRecentDocs() (ret []*RecentDoc, err error) {
 
 
 	var notExists []string
 	var notExists []string
 	for _, doc := range tmp {
 	for _, doc := range tmp {
-		if nil != treenode.GetBlockTree(doc.RootID) {
+		if bt := treenode.GetBlockTree(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)
 			ret = append(ret, doc)
 		} else {
 		} else {
 			notExists = append(notExists, doc.RootID)
 			notExists = append(notExists, doc.RootID)