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/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index 5f4c56aa9..982c56c9d 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -881,6 +881,12 @@ (rx/of (dwu/start-undo-transaction undo-id) (update-component shape-id undo-group) + + ;; These two calls are necessary for properly sync thumbnails + ;; when a main component does not live in the same page + (update-component-thumbnail-sync state component-id file-id "frame") + (update-component-thumbnail-sync state component-id file-id "component") + (sync-file current-file-id file-id :components component-id undo-group) (when (not current-file?) (sync-file file-id file-id :components component-id undo-group)) 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") diff --git a/frontend/src/app/util/text/content/to_dom.cljs b/frontend/src/app/util/text/content/to_dom.cljs index fbf089018..f1f6a994d 100644 --- a/frontend/src/app/util/text/content/to_dom.cljs +++ b/frontend/src/app/util/text/content/to_dom.cljs @@ -73,11 +73,14 @@ ;; it affects to the height calculation the browser does font-size (if (some #(not= "" (:text %)) (:children paragraph)) "0" - (:font-size styles (:font-size txt/default-text-attrs)))] - (cond-> styles - ;; Every paragraph must have line-height to be correctly rendered - (nil? (:line-height styles)) (assoc :line-height (:line-height txt/default-text-attrs)) - true (assoc :font-size font-size)))) + (:font-size styles (:font-size txt/default-text-attrs))) + + line-height (:line-height styles) + line-height (if (and (some? line-height) (not= "" line-height)) + line-height + (:line-height txt/default-text-attrs))] + (-> styles + (assoc :font-size font-size :line-height line-height)))) (defn get-root-styles [root]