From 349b6f6fcef6843538cd3b371cf14978521edcc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Mon, 23 Oct 2023 09:20:34 +0200 Subject: [PATCH] :bug: Fix v2 migration when library has already been migrated --- common/src/app/common/types/file.cljc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/app/common/types/file.cljc b/common/src/app/common/types/file.cljc index 1ac692e4fb..3f5ba802d9 100644 --- a/common/src/app/common/types/file.cljc +++ b/common/src/app/common/types/file.cljc @@ -579,13 +579,13 @@ libraries (assoc-in libraries [(:id file-data) :data] file-data) library (get libraries (:component-file root)) component (ctkl/get-component (:data library) (:component-id root) true) - direct-shape (ctst/get-shape component (:shape-ref shape))] + direct-shape (get-component-shape (:data library) component (:shape-ref shape))] (if (some? direct-shape) ; If it exists, there is nothing else to do. container ; If not found, find the near shape. (let [near-shape (d/seek #(= (:shape-ref %) (:shape-ref shape)) - (ctn/shapes-seq component))] + (get-component-shapes (:data library) component))] (if (some? near-shape) ; If found, update the ref to point to the near shape. (ctn/update-shape container (:id shape) #(assoc % :shape-ref (:id near-shape))) @@ -594,7 +594,7 @@ (let [head (ctn/get-head-shape (:objects container) shape) library-2 (get libraries (:component-file head)) component-2 (ctkl/get-component (:data library-2) (:component-id head) true) - direct-shape-2 (ctst/get-shape component-2 (:shape-ref shape))] + direct-shape-2 (get-component-shape (:data library-2) component-2 (:shape-ref shape))] (if (some? direct-shape-2) ; If it exists, there is nothing else to do. container