mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-25 08:24:06 +01:00
Improve recent documents handling (#16727)
* merge * Update RecentDoc struct to make timestamp fields optional * GetDoc is solely responsible for retrieving document content and does not handle business logic * Remove RemoveRecentDoc function and its calls from multiple files to streamline document handling * Ensure the API correctly returns an empty array, add deduplication logic, and remove redundant sorting steps when updating fields * 🎨 Supports configuring the maximum number of `Recent documents` to be listed https://github.com/siyuan-note/siyuan/issues/16720 * merge * 🎨 Supports configuring the maximum number of `Recent documents` to be listed https://github.com/siyuan-note/siyuan/issues/16720 * 🐛 Fix browsing time not sorted * 🎨 Supports configuring the maximum number of `Recent documents` to be listed https://github.com/siyuan-note/siyuan/issues/16720 * merge * remove async * try catch
This commit is contained in:
parent
fc5a79ff16
commit
b0f71123a3
9 changed files with 398 additions and 220 deletions
|
|
@ -755,7 +755,6 @@ func GetDoc(startID, endID, id string, index int, query string, queryTypes map[s
|
|||
}
|
||||
keywords = gulu.Str.RemoveDuplicatedElem(keywords)
|
||||
|
||||
go setRecentDocByTree(tree)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -1605,7 +1604,6 @@ func removeDoc(box *Box, p string, luteEngine *lute.Lute) {
|
|||
logging.LogInfof("removed doc [%s%s]", box.ID, p)
|
||||
|
||||
box.removeSort(removeIDs)
|
||||
RemoveRecentDoc(removeIDs)
|
||||
if "/" != dir {
|
||||
others, err := os.ReadDir(filepath.Join(util.DataDir, box.ID, dir))
|
||||
if err == nil && 1 > len(others) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue