0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

Do not refetch data: URIs

This commit is contained in:
Aitor 2023-11-10 12:18:16 +01:00 committed by Andrey Antukh
parent b98f693959
commit 95d73494d6

View file

@ -98,10 +98,12 @@
"Updates an image in an SVG to a Data URI."
[image]
(if-let [href (dom/get-attribute image "href")]
(->> (fetch-as-data-uri href)
(rx/map (fn [url]
(dom/set-attribute! image "href" url)
image)))
(if (str/starts-with? href "data:")
(rx/of image)
(->> (fetch-as-data-uri href)
(rx/map (fn [url]
(dom/set-attribute! image "href" url)
image))))
(rx/empty)))
(defn- svg-resolve-images!