From 2b1e126ff8950cbd971c335268d530c9c9194b38 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 18 May 2022 17:04:59 +0200 Subject: [PATCH] :bug: Fix problem with thumbnails --- .../workspace/shapes/frame/thumbnail_render.cljs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/shapes/frame/thumbnail_render.cljs b/frontend/src/app/main/ui/workspace/shapes/frame/thumbnail_render.cljs index 3280108a15..f6926234ab 100644 --- a/frontend/src/app/main/ui/workspace/shapes/frame/thumbnail_render.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/frame/thumbnail_render.cljs @@ -46,12 +46,14 @@ (defn- remove-embed-images-changes "Remove the changes related to change a url for its embed value. This is necessary so we don't have to recalculate the thumbnail when the image loads." - [changes] - (->> changes - (remove (fn [change] - (and (= "attributes" (.-type change)) - (= "href" (.-attributeName change)) - (str/starts-with? (.-oldValue change) "http")))))) + [value] + (if (.isArray js/Array value) + (->> value + (remove (fn [change] + (and (= "attributes" (.-type change)) + (= "href" (.-attributeName change)) + (str/starts-with? (.-oldValue change) "http"))))) + [value])) (defn use-render-thumbnail "Hook that will create the thumbnail thata" @@ -121,6 +123,7 @@ (rx/map remove-embed-images-changes) (rx/filter d/not-empty?) (rx/debounce 400) + (rx/catch (fn [err] (.error js/console err))) (rx/subs on-update-frame))] #(rx/dispose! subid))))