fix: when searching for text which is in a collapsed block, it is not opened

close #4017
pull/4027/head^2
Tienson Qin 2022-01-29 21:19:02 +08:00
parent c370a961aa
commit d1cc77ae0c
3 changed files with 2 additions and 14 deletions

View File

@ -596,7 +596,7 @@
(defn get-block-parents-v2
[repo block-id]
(d/pull (conn/get-conn repo)
'[:db/id :block/properties {:block/parent ...}]
'[:db/id :block/collapsed? :block/properties {:block/parent ...}]
[:block/uuid block-id]))
(defn parents-collapsed?

View File

@ -16,18 +16,6 @@
[repo page-id]
(>= (db/get-page-blocks-count repo page-id) initial-blocks-length))
(defn get-block-ids
[block]
(let [ids (atom [])
_ (walk/prewalk
(fn [form]
(when (map? form)
(when-let [id (:block/uuid form)]
(swap! ids conj id)))
form)
block)]
@ids))
(defn get-block-refs-with-children
[block]
(->>

View File

@ -3492,7 +3492,7 @@
:skip-transact? false}
(doseq [block-id block-ids]
(when-let [block (db/entity [:block/uuid block-id])]
(let [current-value (boolean (util/collapsed? block))]
(let [current-value (:block/collapsed? block)]
(when-not (= current-value value)
(let [block (outliner-core/block {:block/uuid block-id
:block/collapsed? value})]