From 5590210088607a9758e56b972362bfede7f28321 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 21 Feb 2024 14:53:34 +0100 Subject: [PATCH] :bug: Add fix files function to removed :shapes-group from :touched --- backend/src/app/srepl/fixes.clj | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/backend/src/app/srepl/fixes.clj b/backend/src/app/srepl/fixes.clj index c5ba162f0..955f08366 100644 --- a/backend/src/app/srepl/fixes.clj +++ b/backend/src/app/srepl/fixes.clj @@ -117,3 +117,20 @@ (l/trc :hint "file repaired" :file-id (str (:id file)))) file')) + +(defn fix-touched-shapes-group + [file _] + ;; Remove :shapes-group from the touched elements + (letfn [(fix-fdata [data] + (-> data + (update :pages-index update-vals fix-container))) + + (fix-container [container] + (d/update-when container :objects update-vals fix-shape)) + + (fix-shape [shape] + (d/update-when shape :touched + (fn [touched] + (disj touched :shapes-group))))] + file (-> file + (update :data fix-fdata)))) \ No newline at end of file