fix: nested inline block refs

pull/6412/head
Tienson Qin 2022-08-20 09:06:42 +08:00 committed by Andelf
parent 8cbf692601
commit d39947abe0
1 changed files with 2 additions and 5 deletions

View File

@ -2144,13 +2144,10 @@
[:div.more (ui/icon "dots-circle-horizontal" {:style {:fontSize 16}})])]])
(rum/defcs block-content-or-editor < rum/reactive
{:init (fn [state]
(let [[config block] (:rum/args state)
inline-block-refs-hide? (not= (:id config) (str (:block/uuid block)))]
(assoc state ::hide-block-refs? (atom inline-block-refs-hide?))))}
(rum/local true ::hide-block-refs?)
[state config {:block/keys [uuid format] :as block} edit-input-id block-id heading-level edit?]
(let [*hide-block-refs? (get state ::hide-block-refs?)
hide-block-refs? (rum/react *hide-block-refs?)
hide-block-refs? @*hide-block-refs?
editor-box (get config :editor-box)
editor-id (str "editor-" edit-input-id)
slide? (:slide? config)