From 65b7e5c3a5c4571b80d7050e1e4b751ecce9603d Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 27 Nov 2024 10:42:56 +0100 Subject: [PATCH] :bug: Fix incorrect thumbnail rendering on dashboard --- backend/src/app/rpc/commands/files.clj | 6 +----- frontend/src/app/main/render.cljs | 2 +- frontend/src/app/main/ui/shapes/frame.cljs | 1 - 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/backend/src/app/rpc/commands/files.clj b/backend/src/app/rpc/commands/files.clj index 3b746f8ab..19b7637e0 100644 --- a/backend/src/app/rpc/commands/files.clj +++ b/backend/src/app/rpc/commands/files.clj @@ -698,11 +698,7 @@ (defn get-team-recent-files [conn team-id] - (->> (db/exec! conn [sql:team-recent-files team-id]) - (mapv (fn [row] - (if-let [media-id (:thumbnail-id row)] - (assoc row :thumbnail-uri (resolve-public-uri media-id)) - (dissoc row :media-id)))))) + (db/exec! conn [sql:team-recent-files team-id])) (def ^:private schema:get-team-recent-files [:map {:title "get-team-recent-files"} diff --git a/frontend/src/app/main/render.cljs b/frontend/src/app/main/render.cljs index 6ee64dc01..f0a9d14a0 100644 --- a/frontend/src/app/main/render.cljs +++ b/frontend/src/app/main/render.cljs @@ -99,7 +99,7 @@ [{:keys [shape]}] (let [thumbnails? (mf/use-ctx muc/render-thumbnails) childs (mapv (d/getf objects) (:shapes shape))] - (if (and thumbnails? (some? (:thumbnail shape))) + (if (and thumbnails? (some? (:thumbnail-id shape))) [:& frame/frame-thumbnail {:shape shape :bounds (:children-bounds shape)}] [:& frame-shape {:shape shape :childs childs}]))))) diff --git a/frontend/src/app/main/ui/shapes/frame.cljs b/frontend/src/app/main/ui/shapes/frame.cljs index b644b8def..090091d67 100644 --- a/frontend/src/app/main/ui/shapes/frame.cljs +++ b/frontend/src/app/main/ui/shapes/frame.cljs @@ -60,7 +60,6 @@ (mf/defc frame-container {::mf/wrap-props false} [props] - (let [shape (unchecked-get props "shape") children (unchecked-get props "children")