Skip to content

Commit

Permalink
fix: whiteboard back links in page refereneces
Browse files Browse the repository at this point in the history
  • Loading branch information
pengx17 committed Nov 19, 2022
1 parent 7d78258 commit 07d7167
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions deps/graph-parser/src/logseq/graph_parser/whiteboard.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@
{:block/uuid (uuid (:pageId shape))})]))

(defn- with-whiteboard-block-refs
[shape]
[shape page-name]
(let [refs (or (get-shape-refs shape) [])]
(merge {:block/refs refs})))
(merge {:block/refs refs
:block/path-refs (conj refs {:block/name page-name})})))

(defn- with-whiteboard-content
"Main purpose of this function is to populate contents when shapes are used as references in outliner."
Expand All @@ -72,7 +73,7 @@
(merge (if shape?
(merge
{:block/uuid (uuid (:id shape))}
(with-whiteboard-block-refs shape)
(with-whiteboard-block-refs shape page-name)
(with-whiteboard-content shape))

;; TODO: remove?
Expand Down

0 comments on commit 07d7167

Please sign in to comment.