mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -05:00
🐛 Fix import images
This commit is contained in:
parent
d1cce44616
commit
3eb209b602
2 changed files with 4 additions and 0 deletions
|
@ -165,6 +165,8 @@
|
||||||
:uri uri
|
:uri uri
|
||||||
:response-type :blob
|
:response-type :blob
|
||||||
:omit-default-headers true})
|
:omit-default-headers true})
|
||||||
|
|
||||||
|
(rx/filter #(= 200 (:status %)))
|
||||||
(rx/map :body)
|
(rx/map :body)
|
||||||
(rx/mapcat wapi/read-file-as-data-url)
|
(rx/mapcat wapi/read-file-as-data-url)
|
||||||
(rx/map #(hash-map uri %)))))
|
(rx/map #(hash-map uri %)))))
|
||||||
|
|
|
@ -256,6 +256,8 @@
|
||||||
(let [name (cip/get-image-name node)
|
(let [name (cip/get-image-name node)
|
||||||
data-uri (cip/get-image-data node)]
|
data-uri (cip/get-image-data node)]
|
||||||
(->> (upload-media-files file-id name data-uri)
|
(->> (upload-media-files file-id name data-uri)
|
||||||
|
(rx/catch #(do (.error js/console %)
|
||||||
|
(rx/of node)))
|
||||||
(rx/map
|
(rx/map
|
||||||
(fn [media]
|
(fn [media]
|
||||||
(-> node
|
(-> node
|
||||||
|
|
Loading…
Reference in a new issue