🐛 Fix empty font-family handling on custom fonts page.

This commit is contained in:
Andrey Antukh 2021-05-27 13:21:37 +02:00
parent 69ea8229ca
commit ca5c374ecd
2 changed files with 5 additions and 4 deletions

View file

@ -89,7 +89,7 @@
{:content {:data (js/Uint8Array. data) {:content {:data (js/Uint8Array. data)
:name name :name name
:type type} :type type}
:font-family family :font-family (or family "")
:font-weight (cm/parse-font-weight variant) :font-weight (cm/parse-font-weight variant)
:font-style (cm/parse-font-style variant)})) :font-style (cm/parse-font-style variant)}))

View file

@ -192,9 +192,10 @@
on-save on-save
(fn [event] (fn [event]
(let [font-family @state] (let [font-family @state]
(st/emit! (df/update-font (when-not (str/blank? font-family)
{:id font-id (st/emit! (df/update-font
:name font-family})) {:id font-id
:name font-family})))
(reset! edit? false))) (reset! edit? false)))
on-key-down on-key-down