mirror of
https://github.com/penpot/penpot.git
synced 2025-01-25 07:58:49 -05:00
🐛 Fix error first time doing a component change operation
This commit is contained in:
parent
fd6001090e
commit
eeaee5fd13
1 changed files with 12 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue