mirror of
https://github.com/logseq/logseq.git
synced 2026-05-05 19:36:35 +00:00
fix most issues on whiteboards
This commit is contained in:
@@ -7,17 +7,15 @@
|
||||
(defn get-current-page-name
|
||||
"Fetch the current page's original name with same approach as get-current-page-id"
|
||||
[]
|
||||
(or (state/get-current-page)
|
||||
(state/get-current-whiteboard)
|
||||
(or (:block/original-name (db/get-page (state/get-current-page)))
|
||||
(get-in (first (state/get-editor-args)) [:block :block/page :block/original-name])))
|
||||
|
||||
(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"
|
||||
[]
|
||||
(let [page-name (or (state/get-current-page) (state/get-current-whiteboard))]
|
||||
(or (and page-name (db/get-page page-name))
|
||||
(get-in (first (state/get-editor-args)) [:block :block/page :db/id]))))
|
||||
(let [page-name (state/get-current-page)]
|
||||
(:db/id (db/get-page page-name))))
|
||||
|
||||
(defn get-editing-page-id
|
||||
"Fetch the editing page id. If there is an edit-input-id set, we are probably still
|
||||
|
||||
Reference in New Issue
Block a user