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:
parent
7c892cf012
commit
58a86872f5
2 changed files with 16 additions and 6 deletions
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue