mirror of
https://github.com/penpot/penpot.git
synced 2026-03-12 05:16:23 +00:00
Simplify select-for-drawing event implementation.
This commit is contained in:
@@ -109,9 +109,11 @@
|
||||
(reify
|
||||
rs/UpdateEvent
|
||||
(-apply-update [_ state]
|
||||
(if (or (nil? shape) (= (get-in state [:workspace :drawing]) shape))
|
||||
(update-in state [:workspace] dissoc :drawing)
|
||||
(assoc-in state [:workspace :drawing] shape)))))
|
||||
(let [current (get-in state [:workspace :drawing])]
|
||||
(if (or (nil? shape)
|
||||
(= shape current))
|
||||
(update state :workspace dissoc :drawing)
|
||||
(assoc-in state [:workspace :drawing] shape))))))
|
||||
|
||||
;; --- Activate Workspace Flag
|
||||
|
||||
|
||||
Reference in New Issue
Block a user