fix: can't delete selected blocks in queries

This commit is contained in:
Tienson Qin
2022-08-15 11:22:09 +08:00
parent e5532bfe7e
commit 442b65d210

View File

@@ -1073,7 +1073,10 @@
;; remove embeds, references and queries
(let [dom-blocks (remove (fn [block]
(or (= "true" (dom/attr block "data-transclude"))
(= "true" (dom/attr block "data-query")))) blocks)]
(= "true" (dom/attr block "data-query")))) blocks)
dom-blocks (if (seq dom-blocks) dom-blocks
(remove (fn [block]
(or (= "true" (dom/attr block "data-transclude")))) blocks))]
(when (seq dom-blocks)
(let [repo (state/get-current-repo)
block-uuids (distinct (map #(uuid (dom/attr % "blockid")) dom-blocks))