mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
a1781ae34d
1 changed files with 22 additions and 25 deletions
|
|
@ -107,14 +107,14 @@ func setRecentDocByTree(tree *parse.Tree) {
|
|||
return
|
||||
}
|
||||
|
||||
// 更新文档打开时间(只在第一次从文档树加载到页签时调用)
|
||||
func UpdateRecentDocOpenTime(rootID string) error {
|
||||
// UpdateRecentDocOpenTime 更新文档打开时间(只在第一次从文档树加载到页签时调用)
|
||||
func UpdateRecentDocOpenTime(rootID string) (err error) {
|
||||
recentDocLock.Lock()
|
||||
defer recentDocLock.Unlock()
|
||||
|
||||
recentDocs, err := getRecentDocs()
|
||||
if err != nil {
|
||||
return err
|
||||
return
|
||||
}
|
||||
|
||||
// 查找文档并更新打开时间
|
||||
|
|
@ -130,18 +130,17 @@ func UpdateRecentDocOpenTime(rootID string) error {
|
|||
if found {
|
||||
err = setRecentDocs(recentDocs)
|
||||
}
|
||||
|
||||
return err
|
||||
return
|
||||
}
|
||||
|
||||
// 更新文档浏览时间
|
||||
func UpdateRecentDocViewTime(rootID string) error {
|
||||
// UpdateRecentDocViewTime 更新文档浏览时间
|
||||
func UpdateRecentDocViewTime(rootID string) (err error) {
|
||||
recentDocLock.Lock()
|
||||
defer recentDocLock.Unlock()
|
||||
|
||||
recentDocs, err := getRecentDocs()
|
||||
if err != nil {
|
||||
return err
|
||||
return
|
||||
}
|
||||
|
||||
// 查找文档并更新浏览时间
|
||||
|
|
@ -161,18 +160,17 @@ func UpdateRecentDocViewTime(rootID string) error {
|
|||
})
|
||||
err = setRecentDocs(recentDocs)
|
||||
}
|
||||
|
||||
return err
|
||||
return
|
||||
}
|
||||
|
||||
// 更新文档关闭时间
|
||||
func UpdateRecentDocCloseTime(rootID string) error {
|
||||
// UpdateRecentDocCloseTime 更新文档关闭时间
|
||||
func UpdateRecentDocCloseTime(rootID string) (err error) {
|
||||
recentDocLock.Lock()
|
||||
defer recentDocLock.Unlock()
|
||||
|
||||
recentDocs, err := getRecentDocs()
|
||||
if err != nil {
|
||||
return err
|
||||
return
|
||||
}
|
||||
|
||||
// 查找文档并更新关闭时间
|
||||
|
|
@ -188,8 +186,7 @@ func UpdateRecentDocCloseTime(rootID string) error {
|
|||
if found {
|
||||
err = setRecentDocs(recentDocs)
|
||||
}
|
||||
|
||||
return err
|
||||
return
|
||||
}
|
||||
|
||||
func GetRecentDocs(sortBy ...string) (ret []*RecentDoc, err error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue