Pārlūkot izejas kodu

fix: count parent ref for block ref-set

Tienson Qin 5 mēneši atpakaļ
vecāks
revīzija
4c44334ba4
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 5 1
      src/main/frontend/components/block.cljs

+ 5 - 1
src/main/frontend/components/block.cljs

@@ -1350,7 +1350,11 @@
      [])
     (when-not self-reference?
       (if block
-        (let [config' (update config :ref-set (fn [s] (conj (set s) block-id)))]
+        (let [config' (update config :ref-set (fn [s]
+                                                (let [bid (:block/uuid (:block config))]
+                                                  (if (nil? s)
+                                                    #{bid}
+                                                    (conj s bid block-id)))))]
           (block-reference-aux config' block label))
         (invalid-node-ref block-id)))))