From 7a5ee44f85fcddb2b35a854dd2de61762ca346c5 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 7 Aug 2023 19:29:18 +0800 Subject: [PATCH] fix: recursive property block reference --- src/main/frontend/components/block.cljs | 5 +++-- src/main/frontend/components/property.cljs | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index b7aff56457..ccd8cd22a3 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -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)))])))) diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index f0b781a38b..3358f94997 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -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