0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-14 19:19:09 -05:00

Merge pull request #3814 from penpot/azazeln28-fix-color-picker

🐛 Fix color picker
This commit is contained in:
Alejandro 2023-11-23 07:35:50 +01:00 committed by GitHub
commit dce2eb03c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,6 +32,8 @@
[svg-node]
(let [image-nodes (dom/query-all svg-node "image:not([href^=data])")
noop-fn (constantly nil)]
(if (empty? image-nodes)
(rx/of nil)
(->> (rx/from image-nodes)
(rx/mapcat
(fn [image]
@ -41,7 +43,7 @@
(rx/mapcat wapi/read-file-as-data-url)
(rx/tap (fn [data]
(dom/set-attribute! image "href" data)))
(rx/reduce noop-fn))))))))
(rx/reduce noop-fn)))))))))
(defn- svg-as-data-url
"Transforms SVG as data-url resolving any blob, http or https url to