mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-27 09:24:06 +01:00
Remove RemoveRecentDoc function and its calls from multiple files to streamline document handling
This commit is contained in:
parent
ddbcacfe81
commit
f6217c0b50
4 changed files with 1 additions and 27 deletions
|
|
@ -126,29 +126,6 @@ func trimRecentDocs(recentDocs []*RecentDoc) []*RecentDoc {
|
|||
return result
|
||||
}
|
||||
|
||||
func RemoveRecentDoc(ids []string) {
|
||||
recentDocLock.Lock()
|
||||
defer recentDocLock.Unlock()
|
||||
|
||||
recentDocs, err := getRecentDocs("")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
ids = gulu.Str.RemoveDuplicatedElem(ids)
|
||||
for i, doc := range recentDocs {
|
||||
if gulu.Str.Contains(doc.RootID, ids) {
|
||||
recentDocs = append(recentDocs[:i], recentDocs[i+1:]...)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
err = setRecentDocs(recentDocs)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateRecentDocOpenTime 更新文档打开时间(只在第一次从文档树加载到页签时调用)
|
||||
func UpdateRecentDocOpenTime(rootID string) (err error) {
|
||||
recentDocLock.Lock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue