fix: use page uuid for graph url in db graph

We still need to use page name for file graph because pages in
file graph don't have persistent ids.
This commit is contained in:
Tienson Qin
2024-07-26 12:58:44 +08:00
parent 51d9cb9f5e
commit dafec99148
6 changed files with 37 additions and 26 deletions

View File

@@ -10,6 +10,12 @@
(or (:block/title (db/get-page (state/get-current-page)))
(get-in (first (state/get-editor-args)) [:block :block/page :block/title])))
(defn get-current-page-uuid
"Fetch the current page's uuid with same approach as get-current-page-id"
[]
(or (:block/uuid (db/get-page (state/get-current-page)))
(get-in (first (state/get-editor-args)) [:block :block/page :block/uuid])))
(defn get-current-page-id
"Fetches the current page id. Looks up page based on latest route and if
nothing is found, gets page of last edited block"