mirror of https://github.com/penpot/penpot.git
🐛 Fix can't delete unsaved variant prop (#7878)
This commit is contained in:
parent
df7caacb45
commit
00f8eac8fa
|
|
@ -128,14 +128,16 @@
|
||||||
related-components (cfv/find-variant-components data objects variant-id)
|
related-components (cfv/find-variant-components data objects variant-id)
|
||||||
|
|
||||||
props (-> related-components last :variant-properties)
|
props (-> related-components last :variant-properties)
|
||||||
prop-name (-> props (nth pos) :name)
|
valid-pos? (> (count props) pos)
|
||||||
|
prop-name (when valid-pos? (-> props (nth pos) :name))
|
||||||
|
|
||||||
changes (-> (pcb/empty-changes it page-id)
|
changes (when valid-pos?
|
||||||
|
(-> (pcb/empty-changes it page-id)
|
||||||
(pcb/with-objects objects)
|
(pcb/with-objects objects)
|
||||||
(pcb/with-library-data data)
|
(pcb/with-library-data data)
|
||||||
(clvp/generate-update-property-name variant-id pos new-name))
|
(clvp/generate-update-property-name variant-id pos new-name)))
|
||||||
undo-id (js/Symbol)]
|
undo-id (js/Symbol)]
|
||||||
(when (not= prop-name new-name)
|
(when (and valid-pos? (not= prop-name new-name))
|
||||||
(rx/of
|
(rx/of
|
||||||
(dwu/start-undo-transaction undo-id)
|
(dwu/start-undo-transaction undo-id)
|
||||||
(dch/commit-changes changes)
|
(dch/commit-changes changes)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue