mirror of
https://github.com/penpot/penpot.git
synced 2025-07-25 03:27:13 +02:00
🐛 Clean invalid library colors
This commit is contained in:
parent
accd5226d7
commit
9ea3f81bc4
1 changed files with 15 additions and 4 deletions
|
@ -1019,8 +1019,8 @@
|
|||
[data _]
|
||||
(let [update-colors
|
||||
(fn [colors]
|
||||
(into {} (filter #(-> % val types.color/valid-color?) colors)))]
|
||||
(update data :colors update-colors)))
|
||||
(into {} (filter #(-> % val types.color/valid-library-color?) colors)))]
|
||||
(d/update-when data :colors update-colors)))
|
||||
|
||||
(defmethod migrate-data "legacy-52"
|
||||
[data _]
|
||||
|
@ -1034,7 +1034,6 @@
|
|||
|
||||
(update data :pages-index d/update-vals update-page)))
|
||||
|
||||
|
||||
(defmethod migrate-data "legacy-53"
|
||||
[data _]
|
||||
(migrate-data data "legacy-26"))
|
||||
|
@ -1517,6 +1516,17 @@
|
|||
|
||||
(d/update-when data :colors d/update-vals clear-color)))
|
||||
|
||||
(defmethod migrate-data "0009-clean-library-colors"
|
||||
[data _]
|
||||
(d/update-when data :colors
|
||||
(fn [colors]
|
||||
(reduce-kv (fn [colors id color]
|
||||
(if (types.color/valid-library-color? color)
|
||||
colors
|
||||
(dissoc colors id)))
|
||||
colors
|
||||
colors))))
|
||||
|
||||
(def available-migrations
|
||||
(into (d/ordered-set)
|
||||
["legacy-2"
|
||||
|
@ -1580,4 +1590,5 @@
|
|||
"0005-deprecate-image-type"
|
||||
"0006-fix-old-texts-fills"
|
||||
"0007-clear-invalid-strokes-and-fills-v2"
|
||||
"0008-fix-library-colors-v4"]))
|
||||
"0008-fix-library-colors-v4"
|
||||
"0009-clean-library-colors"]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue