From 0d3bd719aa1c1cc7c6ea9e65be86c17972014e3e Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 11 Dec 2022 00:14:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:art:=20=E6=94=AF=E6=8C=81=E5=88=97?= =?UTF-8?q?=E5=87=BA=E5=92=8C=E5=88=87=E6=8D=A2=E6=9C=80=E8=BF=91=E6=89=93?= =?UTF-8?q?=E5=BC=80=E7=9A=84=E6=96=87=E6=A1=A3=20https://github.com/siyua?= =?UTF-8?q?n-note/siyuan/issues/3293?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/file.go | 2 +- kernel/model/storage.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/model/file.go b/kernel/model/file.go index 577e3d628..2e5f800c3 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -660,7 +660,7 @@ func GetDoc(startID, endID, id string, index int, keyword string, mode int, size luteEngine.RenderOptions.NodeIndexStart = index dom = luteEngine.Tree2BlockDOM(subTree, luteEngine.RenderOptions) - SetRecentDocByTree(tree) + SetRecentDocByTree(id, tree) return } diff --git a/kernel/model/storage.go b/kernel/model/storage.go index 5f0527467..e84fc4501 100644 --- a/kernel/model/storage.go +++ b/kernel/model/storage.go @@ -30,6 +30,7 @@ import ( type RecentDoc struct { RootID string `json:"rootID"` + ID string `json:"id"` Icon string `json:"icon"` Title string `json:"title"` ScrollAttr string `json:"scrollAttr"` @@ -63,9 +64,10 @@ func RemoveRecentDoc(ids []string) { return } -func SetRecentDocByTree(tree *parse.Tree) { +func SetRecentDocByTree(id string, tree *parse.Tree) { recentDoc := &RecentDoc{ RootID: tree.Root.ID, + ID: id, Icon: tree.Root.IALAttr("icon"), Title: tree.Root.IALAttr("title"), ScrollAttr: tree.Root.IALAttr("scroll"), From 56511a96d86a710f0a132dda98a7cafa4cc3e138 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 11 Dec 2022 00:20:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?:art:=20=E6=94=AF=E6=8C=81=E5=88=97?= =?UTF-8?q?=E5=87=BA=E5=92=8C=E5=88=87=E6=8D=A2=E6=9C=80=E8=BF=91=E6=89=93?= =?UTF-8?q?=E5=BC=80=E7=9A=84=E6=96=87=E6=A1=A3=20https://github.com/siyua?= =?UTF-8?q?n-note/siyuan/issues/3293?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/storage.go | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/kernel/model/storage.go b/kernel/model/storage.go index e84fc4501..5027246b7 100644 --- a/kernel/model/storage.go +++ b/kernel/model/storage.go @@ -29,13 +29,12 @@ import ( ) type RecentDoc struct { - RootID string `json:"rootID"` - ID string `json:"id"` - Icon string `json:"icon"` - Title string `json:"title"` - ScrollAttr string `json:"scrollAttr"` - Mode string `json:"mode"` - Action string `json:"action"` + RootID string `json:"rootID"` + ID string `json:"id"` + Icon string `json:"icon"` + Title string `json:"title"` + Mode string `json:"mode"` + Action string `json:"action"` } var recentDocLock = sync.Mutex{} @@ -66,11 +65,10 @@ func RemoveRecentDoc(ids []string) { func SetRecentDocByTree(id string, tree *parse.Tree) { recentDoc := &RecentDoc{ - RootID: tree.Root.ID, - ID: id, - Icon: tree.Root.IALAttr("icon"), - Title: tree.Root.IALAttr("title"), - ScrollAttr: tree.Root.IALAttr("scroll"), + RootID: tree.Root.ID, + ID: id, + Icon: tree.Root.IALAttr("icon"), + Title: tree.Root.IALAttr("title"), } SetRecentDoc(recentDoc)