mirror of
https://github.com/penpot/penpot.git
synced 2026-02-25 13:56:04 +00:00
🐛 Fix error first time doing a component change operation
This commit is contained in:
committed by
Alonso Torres
parent
fd6001090e
commit
eeaee5fd13
@@ -887,17 +887,18 @@
|
||||
|
||||
check-changes
|
||||
(fn [[event [old-data _mid_data _new-data]]]
|
||||
(let [{:keys [changes save-undo? undo-group]} (deref event)
|
||||
components-changed (reduce #(into %1 (ch/components-changed old-data %2))
|
||||
#{}
|
||||
changes)]
|
||||
(when (and (d/not-empty? components-changed) save-undo?)
|
||||
(log/info :msg "DETECTED COMPONENTS CHANGED"
|
||||
:ids (map str components-changed)
|
||||
:undo-group undo-group)
|
||||
(run! st/emit!
|
||||
(map #(update-component-sync % (:id old-data) undo-group)
|
||||
components-changed)))))]
|
||||
(when old-data
|
||||
(let [{:keys [changes save-undo? undo-group]} (deref event)
|
||||
components-changed (reduce #(into %1 (ch/components-changed old-data %2))
|
||||
#{}
|
||||
changes)]
|
||||
(when (and (d/not-empty? components-changed) save-undo?)
|
||||
(log/info :msg "DETECTED COMPONENTS CHANGED"
|
||||
:ids (map str components-changed)
|
||||
:undo-group undo-group)
|
||||
(run! st/emit!
|
||||
(map #(update-component-sync % (:id old-data) undo-group)
|
||||
components-changed))))))]
|
||||
|
||||
(when components-v2
|
||||
(->> change-s
|
||||
|
||||
Reference in New Issue
Block a user