0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 17:00:36 -05:00

Add specific event for update page options.

This commit is contained in:
Andrey Antukh 2016-04-13 23:52:01 +03:00
parent 7c892cf012
commit 58a86872f5
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
2 changed files with 16 additions and 6 deletions

View file

@ -168,6 +168,19 @@
(dissoc data :data)
(map->UpdatePageMetadata)))
;; --- Update Page Options
(defrecord UpdatePageOptions [id options]
rs/WatchEvent
(-apply-watch [this state s]
(let [page (get-in state [:pages-by-id id])
page (assoc page :options options)]
(rx/of (map->UpdatePageMetadata page)))))
(defn update-page-options
[id options]
(UpdatePageOptions. id options))
;; --- Delete Page (by id)
(defrecord DeletePage [id callback]

View file

@ -203,12 +203,9 @@
(defrecord UpdateWorkspaceSettings [id options]
rs/WatchEvent
(-apply-watch [_ state s]
(let [page (get-in state [:pages-by-id id])
page (assoc page :options options)]
(rx/of
(udp/update-page-metadata page)
(initialize-alignment-index id)
(udf/clean :workspace/settings))))
(rx/of (udp/update-page-options id options)
(initialize-alignment-index id)
(udf/clean :workspace/settings)))
rs/EffectEvent
(-apply-effect [_ state]