mirror of
https://github.com/penpot/penpot.git
synced 2025-02-04 05:18:56 -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)
|
(dissoc data :data)
|
||||||
(map->UpdatePageMetadata)))
|
(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)
|
;; --- Delete Page (by id)
|
||||||
|
|
||||||
(defrecord DeletePage [id callback]
|
(defrecord DeletePage [id callback]
|
||||||
|
|
|
@ -203,12 +203,9 @@
|
||||||
(defrecord UpdateWorkspaceSettings [id options]
|
(defrecord UpdateWorkspaceSettings [id options]
|
||||||
rs/WatchEvent
|
rs/WatchEvent
|
||||||
(-apply-watch [_ state s]
|
(-apply-watch [_ state s]
|
||||||
(let [page (get-in state [:pages-by-id id])
|
(rx/of (udp/update-page-options id options)
|
||||||
page (assoc page :options options)]
|
(initialize-alignment-index id)
|
||||||
(rx/of
|
(udf/clean :workspace/settings)))
|
||||||
(udp/update-page-metadata page)
|
|
||||||
(initialize-alignment-index id)
|
|
||||||
(udf/clean :workspace/settings))))
|
|
||||||
|
|
||||||
rs/EffectEvent
|
rs/EffectEvent
|
||||||
(-apply-effect [_ state]
|
(-apply-effect [_ state]
|
||||||
|
|
Loading…
Add table
Reference in a new issue