From 8b18115b54f50a16e43f52986d9fed8aadb3bf62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Mon, 15 Jan 2024 15:28:17 +0100 Subject: [PATCH] :bug: Fix validation error when instantiating a component inside 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 3d5cb31c43..f70705230b 100644 --- a/common/src/app/common/types/container.cljc +++ b/common/src/app/common/types/container.cljc @@ -301,6 +301,9 @@ (gpt/add orig-pos delta) {:skip-components? true :bottom-frames? true})) + frame (get-shape container frame-id) + component-frame (get-component-shape (:objects container) frame {:allow-main? true}) + ids-map (volatile! {}) update-new-shape @@ -339,7 +342,8 @@ :component-root true :name new-name) - (some? (:parent-id original-shape)) ;; On v2 we have removed the parent-id for component roots (see above) + (or (some? (:parent-id original-shape)) ; On v2 we have removed the parent-id for component roots (see above) + (some? component-frame)) (dissoc :component-root)))) [new-shape new-shapes _]