fix: show alias page instead of source page on recent and favorite

This commit is contained in:
Tienson Qin
2025-04-24 15:32:55 +08:00
parent 5f3c8328f5
commit 0d7726cb57

View File

@@ -86,7 +86,6 @@
[page icon recent?]
(let [repo (state/get-current-repo)
db-based? (config/db-based-graph? repo)
page (or (db/get-alias-source-page repo (:db/id page)) page)
title (:block/title page)
untitled? (db-model/untitled-page? title)
name (:block/name page)
@@ -783,19 +782,19 @@
[]
(when (state/sub [:document/mode?])
(ui/tooltip
[:a.block.px-1.text-sm.font-medium.bg-base-2.rounded-md.mx-2
{:on-click state/toggle-document-mode!}
"D"]
[:div.p-2
[:p.mb-2 [:b "Document mode"]]
[:ul
[:li
[:div.inline-block.mr-1 (ui/render-keyboard-shortcut (shortcut-dh/gen-shortcut-seq :editor/new-line))]
[:p.inline-block "to create new block"]]
[:li
[:p.inline-block.mr-1 "Click `D` or type"]
[:div.inline-block.mr-1 (ui/render-keyboard-shortcut (shortcut-dh/gen-shortcut-seq :ui/toggle-document-mode))]
[:p.inline-block "to toggle document mode"]]]])))
[:a.block.px-1.text-sm.font-medium.bg-base-2.rounded-md.mx-2
{:on-click state/toggle-document-mode!}
"D"]
[:div.p-2
[:p.mb-2 [:b "Document mode"]]
[:ul
[:li
[:div.inline-block.mr-1 (ui/render-keyboard-shortcut (shortcut-dh/gen-shortcut-seq :editor/new-line))]
[:p.inline-block "to create new block"]]
[:li
[:p.inline-block.mr-1 "Click `D` or type"]
[:div.inline-block.mr-1 (ui/render-keyboard-shortcut (shortcut-dh/gen-shortcut-seq :ui/toggle-document-mode))]
[:p.inline-block "to toggle document mode"]]]])))
(def help-menu-items
[{:title "Handbook" :icon "book-2" :on-click #(handbooks/toggle-handbooks)}