fix: make sure that highlight content exists

This commit is contained in:
Tienson Qin
2022-10-12 22:11:02 +08:00
parent 1321cfefef
commit 53265f6c34

View File

@@ -188,16 +188,17 @@
wrap-props #(if-let [stamp (:image content)]
(assoc % :hl-type "area" :hl-stamp stamp) %)]
(editor-handler/api-insert-new-block!
text (merge {:page (:block/name ref-page)
:custom-uuid id
:properties (wrap-props
{:ls-type "annotation"
:hl-page page
:hl-color (:color properties)
;; force custom uuid
:id (str id)})}
insert-opts)))))))
(when (string? text)
(editor-handler/api-insert-new-block!
text (merge {:page (:block/name ref-page)
:custom-uuid id
:properties (wrap-props
{:ls-type "annotation"
:hl-page page
:hl-color (:color properties)
;; force custom uuid
:id (str id)})}
insert-opts))))))))
(defn del-ref-block!
[{:keys [id]}]