Kaynağa Gözat

fix: count parent ref for block ref-set

Tienson Qin 6 ay önce
ebeveyn
işleme
4c44334ba4
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  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)))))