0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 00:40:30 -05:00

🐛 Fix import images

This commit is contained in:
alonso.torres 2021-07-06 11:19:38 +02:00
parent d1cce44616
commit 3eb209b602
2 changed files with 4 additions and 0 deletions

View file

@ -165,6 +165,8 @@
:uri uri
:response-type :blob
:omit-default-headers true})
(rx/filter #(= 200 (:status %)))
(rx/map :body)
(rx/mapcat wapi/read-file-as-data-url)
(rx/map #(hash-map uri %)))))

View file

@ -256,6 +256,8 @@
(let [name (cip/get-image-name node)
data-uri (cip/get-image-data node)]
(->> (upload-media-files file-id name data-uri)
(rx/catch #(do (.error js/console %)
(rx/of node)))
(rx/map
(fn [media]
(-> node