fix: can't use template for blocks

pull/10438/head
Tienson Qin 2023-09-27 00:11:52 +08:00
parent 71b6695669
commit 1bea86974c
1 changed files with 22 additions and 15 deletions

View File

@ -429,6 +429,13 @@
:multiple-choices? multiple-values?
:dropdown? dropdown?))
:template
(let [id (first (:classes schema))
template (when id (db/entity [:block/uuid id]))]
(when template
(create-new-block-from-template! block property template)
(exit-edit-property)))
(let [config {:editor-opts (new-text-editor-opts repo block property value editor-id)}]
[:div
(editor-box editor-args editor-id (cond-> config