fix: recursive property block reference

This commit is contained in:
Tienson Qin
2023-08-07 19:29:18 +08:00
parent e2c28aa91a
commit 7a5ee44f85
2 changed files with 5 additions and 3 deletions

View File

@@ -2410,7 +2410,7 @@
current-block-page? (= (str (:block/uuid block)) (state/get-current-page))
embed-self? (and (:embed? config)
(= (:block/uuid block) (:block/uuid (:block config))))
default-hide? (if (and current-block-page? (not embed-self?) (state/auto-expand-block-refs?)) false true)]
default-hide? (not (and current-block-page? (not embed-self?) (state/auto-expand-block-refs?)))]
(assoc state ::hide-block-refs? (atom default-hide?))))}
[state config {:block/keys [uuid format] :as block} edit-input-id block-id edit? hide-block-refs-count? selected?]
(let [*hide-block-refs? (get state ::hide-block-refs?)
@@ -2472,7 +2472,8 @@
(block-refs-count block *hide-block-refs?)])]
(when (and (not hide-block-refs?) (> refs-count 0))
(when (and (not hide-block-refs?) (> refs-count 0)
(not (:in-property? config)))
(let [refs-cp (state/get-component :block/linked-references)]
(refs-cp uuid)))]))))

View File

@@ -363,7 +363,8 @@
(if-let [block (db/entity [:block/uuid value])]
[:div.property-block-container.w-full
(block-cp [block] {:id (str value)
:editor-box editor-box})]
:editor-box editor-box
:in-property? true})]
(if multiple-values?
(property-handler/delete-property-value! repo block (:block/uuid property) value)
(property-handler/remove-block-property! repo