From 3eb209b6025ed06577cf67c0d9c1e20d18e77ade Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 6 Jul 2021 11:19:38 +0200 Subject: [PATCH] :bug: Fix import images --- frontend/src/app/util/http.cljs | 2 ++ frontend/src/app/worker/import.cljs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/frontend/src/app/util/http.cljs b/frontend/src/app/util/http.cljs index 8c613bb33..fe60147a3 100644 --- a/frontend/src/app/util/http.cljs +++ b/frontend/src/app/util/http.cljs @@ -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 %))))) diff --git a/frontend/src/app/worker/import.cljs b/frontend/src/app/worker/import.cljs index 107b09231..abcaa1973 100644 --- a/frontend/src/app/worker/import.cljs +++ b/frontend/src/app/worker/import.cljs @@ -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