From 2a752e36250ebc288a74b80d235dbc9afba699d2 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Mon, 22 Apr 2024 11:22:25 +0200 Subject: [PATCH] :bug: swap slot is not copied on copy-paste of a main --- common/src/app/common/types/container.cljc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/types/container.cljc b/common/src/app/common/types/container.cljc index b50c5058a..d038ca50c 100644 --- a/common/src/app/common/types/container.cljc +++ b/common/src/app/common/types/container.cljc @@ -386,7 +386,8 @@ (fn [new-shape original-shape] (let [new-name (:name new-shape) root? (or (ctk/instance-root? original-shape) ; If shape is inside a component (not components-v2) - (nil? (:parent-id original-shape)))] ; we detect it by having no parent) + (nil? (:parent-id original-shape))) ; we detect it by having no parent) + swap-slot (ctk/get-swap-slot original-shape)] (when root? (vswap! unames conj new-name)) @@ -398,6 +399,9 @@ (-> (gsh/move delta) (dissoc :touched)) + (some? swap-slot) + (assoc :touched #{(ctk/build-swap-slot-group swap-slot)}) + (and main-instance? root?) (assoc :main-instance true)