diff --git a/backend/src/app/features/components_v2.clj b/backend/src/app/features/components_v2.clj index 21a47d05f..5b25fa3f1 100644 --- a/backend/src/app/features/components_v2.clj +++ b/backend/src/app/features/components_v2.clj @@ -21,8 +21,10 @@ [app.common.geom.shapes :as gsh] [app.common.logging :as l] [app.common.math :as mth] + [app.common.schema :as sm] [app.common.svg :as csvg] [app.common.svg.shapes-builder :as sbuilder] + [app.common.types.color :as ctc] [app.common.types.component :as ctk] [app.common.types.components-list :as ctkl] [app.common.types.container :as ctn] @@ -113,6 +115,13 @@ (vswap! detached-ids conj (:id shape))) (ctk/detach-shape shape))) + fix-recent-colors + (fn [file-data] + (let [valid-color? (sm/validator ::ctc/recent-color)] + (d/update-when file-data :recent-colors + (fn [colors] + (filterv valid-color? colors))))) + fix-orphan-shapes (fn [file-data] ;; Find shapes that are not listed in their parent's children list. @@ -344,6 +353,7 @@ (update :components update-vals fix-container))))] (-> file-data + (fix-recent-colors) (fix-orphan-shapes) (remove-nested-roots) (add-not-nested-roots) @@ -735,7 +745,7 @@ (defn- create-media-grid [fdata page-id frame-id grid media-group] - (letfn [(process-media-object [fdata mobj position] + (letfn [(process [fdata mobj position] (let [position (gpt/add position (gpt/point grid-gap grid-gap)) tp (dt/tpoint) err (volatile! false)] @@ -785,8 +795,7 @@ (sse/tap {:type :migration-progress :section :graphics :name (:name mobj)}) - (or (process-media-object fdata mobj position) - fdata)) + (or (process fdata mobj position) fdata)) (assoc-in fdata [:options :components-v2] true))))) (defn- migrate-graphics diff --git a/backend/src/app/srepl/components_v2.clj b/backend/src/app/srepl/components_v2.clj index 7c82d1b1c..ddc320701 100644 --- a/backend/src/app/srepl/components_v2.clj +++ b/backend/src/app/srepl/components_v2.clj @@ -204,7 +204,7 @@ sprocs (ps/create :permits max-procs) cache (if (int? cache) - (cache/create :executor (::wrk/executor main/system) + (cache/create :executor :same-thread :max-items cache) nil)