mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
🐛 Fix set as thumbnail generate 2 steps for undo
This commit is contained in:
parent
445519fc70
commit
dd5ec39619
1 changed files with 5 additions and 2 deletions
|
@ -436,9 +436,11 @@
|
|||
ptk/WatchEvent
|
||||
(watch [_ state _]
|
||||
(let [selected (wsh/lookup-selected state)
|
||||
pages (-> state :workspace-data :pages-index vals)]
|
||||
pages (-> state :workspace-data :pages-index vals)
|
||||
undo-id (js/Symbol)]
|
||||
|
||||
(rx/concat
|
||||
(rx/of (dwu/start-undo-transaction undo-id))
|
||||
;; First: clear the `:use-for-thumbnail` flag from all not
|
||||
;; selected frames.
|
||||
(rx/from
|
||||
|
@ -456,4 +458,5 @@
|
|||
(dch/update-shapes frame-ids #(dissoc % :use-for-thumbnail) {:page-id page-id})))))
|
||||
|
||||
;; And finally: toggle the flag value on all the selected shapes
|
||||
(rx/of (dch/update-shapes selected #(update % :use-for-thumbnail not))))))))
|
||||
(rx/of (dch/update-shapes selected #(update % :use-for-thumbnail not))
|
||||
(dwu/commit-undo-transaction undo-id)))))))
|
||||
|
|
Loading…
Add table
Reference in a new issue