From 76b7272a728cc67504f8edca103e6bcecc1d4836 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 18 Jan 2021 12:30:09 +0100 Subject: [PATCH] :bug: Fixed paste components from other files --- frontend/src/app/main/data/workspace.cljs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index d59573b8e..21e3a2563 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -1360,7 +1360,17 @@ (d/mapm (fn [_ shape] (-> shape (assoc :frame-id frame-id) - (assoc :parent-id parent-id))))) + (assoc :parent-id parent-id) + + (cond-> + ;; Pasting from another file, we deattach components + (not= (:current-file-id state) (:file-id data)) + (dissoc :component-id + :component-file + :component-root? + :remote-synced? + :shape-ref + :touched)))))) page-id (:current-page-id state) unames (-> (dwc/lookup-page-objects state page-id) @@ -1394,7 +1404,7 @@ mouse-pos (deref ms/mouse-position)] (if (= file-id (:file-id data)) (do-paste state mouse-pos []) - (->> (rx/from (seq images)) + (->> (rx/from images) (rx/merge-map (partial upload-media file-id)) (rx/reduce conj []) (rx/mapcat (partial do-paste state mouse-pos)))))))))