0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-25 07:58:49 -05:00

Add activate flag event for proper flag activation independently of state.

This commit is contained in:
Andrey Antukh 2016-04-13 20:45:29 +03:00
parent 41073a7b57
commit c743c94450
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -85,6 +85,17 @@
(assoc-in state [:workspace :drawing] shape)
(update-in state [:workspace] dissoc :drawing)))))
;; --- Activate Workspace Flag
(defrecord ActivateFlag [flag]
rs/UpdateEvent
(-apply-update [_ state]
(update-in state [:workspace :flags] conj flag)))
(defn activate-flag
[flag]
(ActivateFlag. flag))
;; --- Copy to Clipboard
(defrecord CopyToClipboard []
@ -172,7 +183,7 @@
:x-axis (:grid/x-axis opts c/grid-x-axis)
:y-axis (:grid/y-axis opts c/grid-y-axis)}]
(->> (uw/send! worker message)
(rx/map #(toggle-flag :alignment/indexed))))))
(rx/map #(activate-flag :alignment/indexed))))))
(defn initialize-alignment-index
[id]