💄 Fix minor cosmetic issues on components-v2 feature ns

This commit is contained in:
Andrey Antukh 2024-01-29 15:38:44 +01:00
parent 295d9568c8
commit 9ca7c4280c

View file

@ -185,12 +185,10 @@
fix-missing-image-metadata fix-missing-image-metadata
(fn [file-data] (fn [file-data]
;; Delete broken image shapes with no metadata. ;; Delete broken image shapes with no metadata.
(letfn [(fix-container (letfn [(fix-container [container]
[container]
(d/update-when container :objects #(reduce-kv fix-shape % %))) (d/update-when container :objects #(reduce-kv fix-shape % %)))
(fix-shape (fix-shape [objects id shape]
[objects id shape]
(if (and (cfh/image-shape? shape) (if (and (cfh/image-shape? shape)
(nil? (:metadata shape))) (nil? (:metadata shape)))
(-> objects (-> objects
@ -435,12 +433,10 @@
(fn [file-data] (fn [file-data]
;; Find children shapes whose parent-id is not set to the parent that contains them. ;; Find children shapes whose parent-id is not set to the parent that contains them.
;; Remove them from the parent :shapes list. ;; Remove them from the parent :shapes list.
(letfn [(fix-container (letfn [(fix-container [container]
[container]
(d/update-when container :objects #(reduce-kv fix-shape % %))) (d/update-when container :objects #(reduce-kv fix-shape % %)))
(fix-shape (fix-shape [objects id shape]
[objects id shape]
(reduce (fn [objects child-id] (reduce (fn [objects child-id]
(let [child (get objects child-id)] (let [child (get objects child-id)]
(cond-> objects (cond-> objects