fix: Template properties causes empty "template" property to show up

address #6839
This commit is contained in:
Tienson Qin
2022-09-29 10:44:16 +08:00
parent 82cd5c53f4
commit 00c1a238c1

View File

@@ -1988,6 +1988,12 @@
root-block (db/pull db-id)
blocks-exclude-root (remove (fn [b] (= (:db/id b) db-id)) blocks)
sorted-blocks (tree/sort-blocks blocks-exclude-root root-block)
sorted-blocks (cons
(-> (first sorted-blocks)
(update :block/properties-text-values dissoc :template)
(update :block/properties-order (fn [keys]
(vec (remove #{:template} keys)))))
(rest sorted-blocks))
blocks (if template-including-parent?
sorted-blocks
(drop 1 sorted-blocks))]