fix: whiteboard not working because of properties

This commit is contained in:
Tienson Qin
2023-10-12 21:17:31 +08:00
parent aeabee7be3
commit 9f0eec2402
7 changed files with 67 additions and 50 deletions

View File

@@ -7,7 +7,8 @@
[logseq.db.property :as db-property]
[logseq.graph-parser.util :as gp-util]
[frontend.db :as db]
[clojure.set :as set]))
[clojure.set :as set]
[frontend.util :as util]))
(defn lookup
"Get the value of coll's (a map) `key`"
@@ -31,6 +32,14 @@
[uuid]
(:block/original-name (db/entity [:block/uuid uuid])))
(defn get-pid
"Get a property's UUID given its name or key"
[property-name]
(let [repo (state/get-current-repo)]
(if (config/db-based-graph? repo)
(:block/uuid (db/entity [:block/name (util/page-name-sanity-lc (name property-name))]))
property-name)))
(defn block->shape [block]
(get-property block :logseq.tldraw.shape))