From 8a158146cd9c95296672f8983023506639ea940c Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 13 Sep 2021 11:10:32 +0200 Subject: [PATCH] :bug: Fix problem with import broken images --- CHANGES.md | 1 + frontend/src/app/worker/import.cljs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 44f251ba8..d502cc512 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -39,6 +39,7 @@ - Fix problems with order in groups [Taiga #1960](https://tree.taiga.io/project/penpot/issue/1960) - Fix SVG components preview [#1134](https://github.com/penpot/penpot/issues/1134) - Fix group renaming problem [Taiga #1969](https://tree.taiga.io/project/penpot/issue/1969) +- Fix problem with import broken images links [#1197](https://github.com/penpot/penpot/issues/1197) ### :arrow_up: Deps updates ### :boom: Breaking changes diff --git a/frontend/src/app/worker/import.cljs b/frontend/src/app/worker/import.cljs index 5891d4ea4..fc6c8a4c1 100644 --- a/frontend/src/app/worker/import.cljs +++ b/frontend/src/app/worker/import.cljs @@ -255,7 +255,7 @@ (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/catch #(do (.error js/console "Error uploading media: " name) (rx/of node))) (rx/map (fn [media] @@ -370,7 +370,9 @@ :content content :is-local false}))) (rx/flat-map #(rp/mutation! :upload-file-media-object %)) - (rx/map (constantly media)))))) + (rx/map (constantly media)) + (rx/catch #(do (.error js/console (str "Error uploading media: " (:name media)) ) + (rx/empty))))))) (rx/reduce fb/add-library-media file))) (rx/of file)))