diff --git a/common/app/common/pages.cljc b/common/app/common/pages.cljc index c92015a04..c5ad442da 100644 --- a/common/app/common/pages.cljc +++ b/common/app/common/pages.cljc @@ -963,14 +963,14 @@ :objects (d/index-by :id shapes)})) (defmethod process-change :mod-component - [data {:keys [id name shapes]}] + [data {:keys [id name objects]}] (update-in data [:components id] #(cond-> % (some? name) (assoc :name name) - (some? shapes) - (assoc :objects (d/index-by :id shapes))))) + (some? objects) + (assoc :objects objects)))) (defmethod process-change :del-component [data {:keys [id]}] diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index 7809f40fa..9fb6ef150 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -261,14 +261,20 @@ ptk/WatchEvent (watch [_ state stream] (let [component (get-in state [:workspace-data :components id]) + objects (get component :objects) + new-objects (assoc-in objects + [(:id component) :name] + new-name) rchanges [{:type :mod-component :id id - :name new-name}] + :name new-name + :objects new-objects}] uchanges [{:type :mod-component :id id - :name (:name component)}]] + :name (:name component) + :objects objects}]] (rx/of (dwc/commit-changes rchanges uchanges {:commit-local? true}))))))