From 10d6f93ed7702d5a2dd76169c99f0ef17115f21d Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 23 Feb 2024 12:19:37 +0100 Subject: [PATCH] :bug: Fix detach components with shortcut --- frontend/src/app/main/data/workspace/libraries.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index e43d75b23..8c6845de5 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -618,11 +618,13 @@ (wsh/lookup-selected) (cfh/clean-loops objects)) selected-objects (map #(get objects %) selected) - can-detach? (every? #(not (ctn/has-any-copy-parent? objects %)) selected-objects) + copies (filter ctk/in-component-copy? selected-objects) + can-detach? (and (seq copies) + (every? #(not (ctn/has-any-copy-parent? objects %)) selected-objects)) changes (when can-detach? (reduce (fn [changes id] - (dwlh/generate-detach-instance changes libraries container id)) + (dwlh/generate-detach-instance changes container libraries id)) (-> (pcb/empty-changes it) (pcb/with-container container) (pcb/with-objects objects))