fix: favorite page prefer id instead of name

This commit is contained in:
Tienson Qin
2024-08-19 11:25:03 +08:00
parent 562c83eab2
commit 0876198cca
4 changed files with 8 additions and 7 deletions

View File

@@ -74,6 +74,7 @@
(rum/defc page-name
[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)
whiteboard-page? (db-model/whiteboard-page? page)
@@ -91,7 +92,7 @@
[:<>
(when-not recent?
(x-menu-item
{:on-click #(page-handler/<unfavorite-page! title)}
{:on-click #(page-handler/<unfavorite-page! (if db-based? (str (:block/uuid page)) title))}
(ctx-icon "star-off")
(t :page/unfavorite)
(x-menu-shortcut (when-let [binding (shortcut-dh/shortcut-binding :command/toggle-favorite)]