diff --git a/frontend/src/app/main/ui/shapes/text.cljs b/frontend/src/app/main/ui/shapes/text.cljs index 7f061eee6..6449c3e64 100644 --- a/frontend/src/app/main/ui/shapes/text.cljs +++ b/frontend/src/app/main/ui/shapes/text.cljs @@ -38,7 +38,7 @@ {:style style :xmlns "http://www.w3.org/1999/xhtml"} (when embed? - [ste/embed-fontfaces-style {:node node}]) + [:& ste/embed-fontfaces-style {:node node}]) children])) (mf/defc render-paragraph-set diff --git a/frontend/src/app/main/ui/shapes/text/embed.cljs b/frontend/src/app/main/ui/shapes/text/embed.cljs index 1b1475a60..b487bb25f 100644 --- a/frontend/src/app/main/ui/shapes/text/embed.cljs +++ b/frontend/src/app/main/ui/shapes/text/embed.cljs @@ -89,17 +89,16 @@ (with-cache {:key uris :max-age (dt/duration {:hours 4})} (->> (rx/from (seq uris)) (rx/mapcat (fn [uri] - (http/send! {:method :get - :uri uri - :response-type :blob}))) - (rx/map :body))))) + (->> (http/send! {:method :get :uri uri :response-type :blob}) + (rx/map :body) + (rx/mapcat wapi/read-file-as-data-url) + (rx/map #(vector uri %))))) + (rx/reduce conj []))))) (defn get-font-data "Parses the CSS and retrieves the font data as DataURI." [^string css] (->> (fetch-font-data css) - (rx/mapcat wapi/read-file-as-data-url) - (rx/reduce conj []) (http/as-promise))) (defn embed-font