diff --git a/backend/src/app/features/components_v2.clj b/backend/src/app/features/components_v2.clj index 1aaa5e268..3506e415e 100644 --- a/backend/src/app/features/components_v2.clj +++ b/backend/src/app/features/components_v2.clj @@ -414,6 +414,16 @@ (update :pages-index update-vals fix-container) (d/update-when :components update-vals fix-container)))) + fix-empty-components + (fn [file-data] + (letfn [(fix-component [components id component] + (if (empty? (:objects component)) + (dissoc components id) + components))] + + (-> file-data + (d/update-when :components #(reduce-kv fix-component % %))))) + fix-misc-shape-issues (fn [file-data] (letfn [(fix-container [container] @@ -919,6 +929,7 @@ (fix-broken-paths) (fix-big-geometry-shapes) (fix-shape-geometry) + (fix-empty-components) (fix-completly-broken-shapes) (fix-bad-children) (fix-broken-parents)