From 95d73494d6135ad01f1980734b6d0f80e7a32d75 Mon Sep 17 00:00:00 2001 From: Aitor Date: Fri, 10 Nov 2023 12:18:16 +0100 Subject: [PATCH] :zap: Do not refetch data: URIs --- frontend/src/app/rasterizer.cljs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/rasterizer.cljs b/frontend/src/app/rasterizer.cljs index fd254288f..81f240d0a 100644 --- a/frontend/src/app/rasterizer.cljs +++ b/frontend/src/app/rasterizer.cljs @@ -98,10 +98,12 @@ "Updates an image in an SVG to a Data URI." [image] (if-let [href (dom/get-attribute image "href")] - (->> (fetch-as-data-uri href) - (rx/map (fn [url] - (dom/set-attribute! image "href" url) - image))) + (if (str/starts-with? href "data:") + (rx/of image) + (->> (fetch-as-data-uri href) + (rx/map (fn [url] + (dom/set-attribute! image "href" url) + image)))) (rx/empty))) (defn- svg-resolve-images!