fix: whiteboard not working because of properties

This commit is contained in:
Tienson Qin
2023-10-12 21:17:31 +08:00
parent aeabee7be3
commit 9f0eec2402
7 changed files with 67 additions and 50 deletions

View File

@@ -192,15 +192,19 @@
ref-block)
(let [text (:text content)
wrap-props #(if-let [stamp (:image content)]
(assoc % :hl-type :area :hl-stamp stamp)
(assoc %
(pu/get-pid :hl-type) :area
(pu/get-pid :hl-stamp) stamp)
%)
props (cond->
{(pu/get-pid :ls-type) :annotation
(pu/get-pid :hl-page) page
(pu/get-pid :hl-color) (:color properties)}
(not (config/db-based-graph? (state/get-current-repo)))
;; force custom uuid
(assoc (pu/get-pid :id) (str id)))
properties (->>
(wrap-props
{:ls-type :annotation
:hl-page page
:hl-color (:color properties)
;; force custom uuid
:id (str id)})
(wrap-props props)
(property-handler/replace-key-with-id! (state/get-current-repo)))]
(when (string? text)
(editor-handler/api-insert-new-block!