mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 17:06:38 +02: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
|
ptk/WatchEvent
|
||||||
(watch [_ state _]
|
(watch [_ state _]
|
||||||
(let [selected (wsh/lookup-selected 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/concat
|
||||||
|
(rx/of (dwu/start-undo-transaction undo-id))
|
||||||
;; First: clear the `:use-for-thumbnail` flag from all not
|
;; First: clear the `:use-for-thumbnail` flag from all not
|
||||||
;; selected frames.
|
;; selected frames.
|
||||||
(rx/from
|
(rx/from
|
||||||
|
@ -456,4 +458,5 @@
|
||||||
(dch/update-shapes frame-ids #(dissoc % :use-for-thumbnail) {:page-id page-id})))))
|
(dch/update-shapes frame-ids #(dissoc % :use-for-thumbnail) {:page-id page-id})))))
|
||||||
|
|
||||||
;; And finally: toggle the flag value on all the selected shapes
|
;; 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
Add a link
Reference in a new issue