From 787c06635762f4228be7ec7ded4fdd612140f64a Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 25 Jun 2025 11:23:39 +0200 Subject: [PATCH] :bug: Remove qualified keyword keys from colors --- common/src/app/common/files/migrations.cljc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/common/src/app/common/files/migrations.cljc b/common/src/app/common/files/migrations.cljc index 11eb0dfed9..aa56dbe65d 100644 --- a/common/src/app/common/files/migrations.cljc +++ b/common/src/app/common/files/migrations.cljc @@ -1468,14 +1468,21 @@ (update :pages-index d/update-vals update-container) (d/update-when :components d/update-vals update-container)))) -(defmethod migrate-data "0008-fix-library-colors-opacity" +(defmethod migrate-data "0008-fix-library-colors" [data _] - (letfn [(update-color [color] + (letfn [(clear-color-opacity [color] (if (and (contains? color :opacity) (nil? (get color :opacity))) (assoc color :opacity 1) - color))] - (d/update-when data :colors d/update-vals update-color))) + color)) + + (clear-color [color] + (-> color + (d/without-nils) + (d/without-qualified) + (clear-color-opacity)))] + + (d/update-when data :colors d/update-vals clear-color))) (def available-migrations (into (d/ordered-set) @@ -1540,4 +1547,4 @@ "0005-deprecate-image-type" "0006-fix-old-texts-fills" "0007-clear-invalid-strokes-and-fills-v2" - "0008-fix-library-colors-opacity"])) + "0008-fix-library-colors"]))