🐛 Fix incorrect library color cleaning mechanism

This commit is contained in:
Andrey Antukh 2025-06-25 14:36:33 +02:00
parent 4561392791
commit 903aba5642
2 changed files with 3 additions and 5 deletions

View file

@ -1480,7 +1480,7 @@
(update :pages-index d/update-vals update-container)
(d/update-when :components d/update-vals update-container))))
(defmethod migrate-data "0008-fix-library-colors-v2"
(defmethod migrate-data "0008-fix-library-colors-v3"
[data _]
(letfn [(clear-color-opacity [color]
(if (and (contains? color :opacity)
@ -1491,8 +1491,6 @@
(clear-color [color]
(-> color
(select-keys types.color/library-color-attrs)
(d/without-nils)
(d/without-qualified)
(clear-color-opacity)))]
(d/update-when data :colors d/update-vals clear-color)))
@ -1560,4 +1558,4 @@
"0005-deprecate-image-type"
"0006-fix-old-texts-fills"
"0007-clear-invalid-strokes-and-fills-v2"
"0008-fix-library-colors-v2"]))
"0008-fix-library-colors-v3"]))

View file

@ -151,7 +151,7 @@
[:fn has-valid-color-attrs?]])
(def library-color-attrs
(sm/keys schema:library-color-attrs))
(into required-color-attrs (sm/keys schema:library-color-attrs)))
(def valid-color?
(sm/lazy-validator schema:color))