0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-15 17:21:17 -05:00

Fixed click on project after project creation

This commit is contained in:
Jesús Espino 2016-12-22 11:41:04 +01:00
parent 0424315849
commit a3586cb3aa

View file

@ -159,14 +159,18 @@
(defrecord CreateProject [name width height layout]
ptk/WatchEvent
(watch [this state s]
(letfn [(on-success [{project :payload}]
(rx/of
(project-persisted project)
(udp/create-page {:width width
:height height
:layout layout
:project (:id project)
:name "Page 1" })))]
(letfn [(on-finish [{project :payload}]
(rx/of (fetch-projects)))
(on-success [{project :payload}]
(->> (rp/req :create/page
{:name name
:project (:id project)
:data {}
:metadata {:width width
:height height
:layout layout
:order 0}})
(rx/mapcat on-finish)))]
(->> (rp/req :create/project {:name name})
(rx/mapcat on-success)))))