mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 00:01:51 -05:00
🐛 Force persistence on go to dashboard.
This commit is contained in:
parent
3348370138
commit
b6f359bcb8
2 changed files with 17 additions and 7 deletions
|
@ -227,10 +227,12 @@
|
|||
(ptk/reify ::initialize-page
|
||||
ptk/UpdateEvent
|
||||
(update [_ state]
|
||||
(let [prev-local (get state :workspace-local)
|
||||
(let [;; we maintain a cache of page state for user convenience
|
||||
;; with the exception of the selection; when user abandon
|
||||
;; the current page, the selection is lost
|
||||
local (-> state
|
||||
(get-in [:workspace-cache page-id] workspace-local-default)
|
||||
(merge (select-keys prev-local [:vbox :vport :zoom])))
|
||||
(assoc :selected (d/ordered-set)))
|
||||
page (-> (get-in state [:workspace-data :pages-index page-id])
|
||||
(select-keys [:id :name]))]
|
||||
(assoc state
|
||||
|
@ -1225,6 +1227,14 @@
|
|||
(rx/of ::dwp/force-persist
|
||||
(rt/nav :viewer params {:index 0})))))
|
||||
|
||||
(defn go-to-dashboard
|
||||
[{:keys [team-id] :as project}]
|
||||
(ptk/reify ::go-to-viewer
|
||||
ptk/WatchEvent
|
||||
(watch [_ state stream]
|
||||
(rx/of ::dwp/force-persist
|
||||
(rt/nav :dashboard-projects {:team-id team-id})))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Context Menu
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -242,7 +242,7 @@
|
|||
go-back
|
||||
(mf/use-callback
|
||||
(mf/deps project)
|
||||
(st/emitf (rt/nav :dashboard-projects {:team-id team-id})))
|
||||
(st/emitf (dw/go-to-dashboard project)))
|
||||
|
||||
go-viewer
|
||||
(mf/use-callback
|
||||
|
|
Loading…
Add table
Reference in a new issue