🐛 Fix problem with texts for non existing fonts

This commit is contained in:
alonso.torres 2022-09-07 11:12:30 +02:00
parent 00a7760c0f
commit c47f5ca186
3 changed files with 4 additions and 2 deletions

View file

@ -181,7 +181,7 @@
(rx/tap
(fn [resp]
(when (or (< (:status resp) 200) (>= (:status resp) 300))
(rx/throw (js/Error. "Error fetching data uri" #js {:cause (clj->js resp)})))))
(throw (js/Error. "Error fetching data uri" #js {:cause (clj->js resp)})))))
(rx/map :body)
(rx/mapcat wapi/read-file-as-data-url)

View file

@ -56,7 +56,8 @@
(-> (fonts/ensure-loaded! font-id)
(p/then #(when (not (dom/check-font? font))
(load-font font))))))
(load-font font)))
(p/catch #(.error js/console (dm/str "Cannot load font" font-id) %)))))
(defn- calc-text-node-positions
[shape-id]