mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
🎨 支持列出和切换最近打开的文档 https://github.com/siyuan-note/siyuan/issues/3293
This commit is contained in:
parent
d679bedd77
commit
3b1b62fb7e
1 changed files with 3 additions and 6 deletions
|
|
@ -80,17 +80,14 @@ func SetRecentDoc(doc *RecentDoc) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
update := false
|
||||
for i, c := range recentDocs {
|
||||
if c.RootID == doc.RootID {
|
||||
recentDocs[i] = doc
|
||||
update = true
|
||||
recentDocs = append(recentDocs[:i], recentDocs[i+1:]...)
|
||||
break
|
||||
}
|
||||
}
|
||||
if !update {
|
||||
recentDocs = append([]*RecentDoc{doc}, recentDocs...)
|
||||
}
|
||||
|
||||
recentDocs = append([]*RecentDoc{doc}, recentDocs...)
|
||||
if 32 < len(recentDocs) {
|
||||
recentDocs = recentDocs[:32]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue