mirror of
https://github.com/penpot/penpot.git
synced 2025-05-30 00:36:13 +02:00
✨ Improve pages fetching on dashboard.
This commit is contained in:
parent
426677935e
commit
761a3c102f
4 changed files with 14 additions and 14 deletions
|
@ -75,11 +75,6 @@
|
|||
(update [_ state]
|
||||
(reduce assoc-project state projects))))
|
||||
|
||||
;; ptk/WatchEvent
|
||||
;; (watch [_ state stream]
|
||||
;; (->> (rx/from-coll (map :id projects))
|
||||
;; (rx/map udp/fetch-pages))))
|
||||
|
||||
(defn projects-fetched?
|
||||
[v]
|
||||
(= ::projects-fetched (ptk/type v)))
|
||||
|
@ -177,8 +172,8 @@
|
|||
(ptk/reify ::go-to
|
||||
ptk/WatchEvent
|
||||
(watch [_ state stream]
|
||||
(let [page-id (get-in state [:projects id :ref-page-id])]
|
||||
(let [params {:project id :page page-id}]
|
||||
(let [page-ids (get-in state [:projects id :pages])]
|
||||
(let [params {:project id :page (first page-ids)}]
|
||||
(rx/of (rt/nav :workspace/page params)))))))
|
||||
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
;; Activate loaded if page is not fetched.
|
||||
(when-not page (reset! st/loader true))
|
||||
(rx/merge
|
||||
;; TODO: the `fetch-pages` should fetch a limited set of attrs
|
||||
;; TODO: the `fetch-pages` should fetch a limited set of attrs?
|
||||
(rx/of (udp/fetch-page page-id))
|
||||
(rx/of (udp/fetch-pages project-id))
|
||||
(->> stream
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue