mirror of
https://github.com/penpot/penpot.git
synced 2025-01-25 07:58:49 -05:00
⚡ Do not refetch data: URIs
This commit is contained in:
parent
b98f693959
commit
95d73494d6
1 changed files with 6 additions and 4 deletions
|
@ -98,10 +98,12 @@
|
||||||
"Updates an image in an SVG to a Data URI."
|
"Updates an image in an SVG to a Data URI."
|
||||||
[image]
|
[image]
|
||||||
(if-let [href (dom/get-attribute image "href")]
|
(if-let [href (dom/get-attribute image "href")]
|
||||||
|
(if (str/starts-with? href "data:")
|
||||||
|
(rx/of image)
|
||||||
(->> (fetch-as-data-uri href)
|
(->> (fetch-as-data-uri href)
|
||||||
(rx/map (fn [url]
|
(rx/map (fn [url]
|
||||||
(dom/set-attribute! image "href" url)
|
(dom/set-attribute! image "href" url)
|
||||||
image)))
|
image))))
|
||||||
(rx/empty)))
|
(rx/empty)))
|
||||||
|
|
||||||
(defn- svg-resolve-images!
|
(defn- svg-resolve-images!
|
||||||
|
|
Loading…
Add table
Reference in a new issue