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:
parent
0424315849
commit
a3586cb3aa
1 changed files with 12 additions and 8 deletions
|
@ -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)))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue