From adc6af129c3f963a045d7bc5cd2eed2c831e9ddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 22 Jun 2023 11:32:31 +0200 Subject: [PATCH] wip --- .../src/app/main/data/workspace/libraries.cljs | 2 +- .../app/main/data/workspace/libraries_helpers.cljs | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index edff00bc3..092e44fa2 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -43,7 +43,7 @@ [potok.core :as ptk])) ;; Change this to :info :debug or :trace to debug this module, or :warn to reset to default -(log/set-level! :warn) +(log/set-level! :debug) (defn- log-changes [changes file] diff --git a/frontend/src/app/main/data/workspace/libraries_helpers.cljs b/frontend/src/app/main/data/workspace/libraries_helpers.cljs index ebe7e1cdd..12346e0d9 100644 --- a/frontend/src/app/main/data/workspace/libraries_helpers.cljs +++ b/frontend/src/app/main/data/workspace/libraries_helpers.cljs @@ -181,12 +181,14 @@ (not (nil? parent-id)) (assoc :parent-id parent-id)) - changes (cond-> (pcb/add-object changes first-shape {:ignore-touched true}) - (some? old-id) (pcb/amend-last-change #(assoc % :old-id old-id))) ; on copy/paste old id is used later to reorder the paster layers - - changes (reduce #(pcb/add-object %1 %2 {:ignore-touched true}) - changes - (rest new-shapes))] + changes (as-> changes $ + (pcb/add-object $ first-shape {:ignore-touched true}) + (cond-> $ + (some? old-id) + (pcb/amend-last-change #(assoc % :old-id old-id))) ; on copy/paste old id is used later to reorder the paster layers + (reduce #(pcb/add-object %1 %2 {:ignore-touched true}) + $ + (rest new-shapes)))] [new-shape changes])))