mirror of
https://github.com/penpot/penpot.git
synced 2025-03-26 06:31:26 -05:00
🐛 Remove unnecesary redirect when user goes from dashboard to workspace.
And then, clicks the browser back button.
This commit is contained in:
parent
1d6905cb25
commit
a8523f41b3
3 changed files with 17 additions and 18 deletions
|
@ -13,6 +13,9 @@
|
|||
becomes inactive.
|
||||
|
||||
### :bug: Bugs fixed
|
||||
|
||||
- Remove unnecesary redirect from history when user goes to workspace from dashboard [Taiga 1820](https://tree.taiga.io/project/penpot/issue/1820).
|
||||
|
||||
### :arrow_up: Deps updates
|
||||
### :boom: Breaking changes
|
||||
### :heart: Community contributions by (Thank you!)
|
||||
|
|
|
@ -214,8 +214,6 @@
|
|||
(rx/of (dwn/finalize file-id)
|
||||
::dwp/finalize))))
|
||||
|
||||
(declare go-to-page)
|
||||
|
||||
(defn initialize-page
|
||||
[page-id]
|
||||
(us/assert ::us/uuid page-id)
|
||||
|
@ -1193,7 +1191,6 @@
|
|||
|
||||
(defn go-to-page
|
||||
([]
|
||||
|
||||
(ptk/reify ::go-to-page
|
||||
ptk/WatchEvent
|
||||
(watch [it state stream]
|
||||
|
@ -1203,7 +1200,7 @@
|
|||
|
||||
pparams {:file-id file-id :project-id project-id}
|
||||
qparams {:page-id page-id}]
|
||||
(rx/of (rt/nav :workspace pparams qparams))))))
|
||||
(rx/of (rt/nav' :workspace pparams qparams))))))
|
||||
([page-id]
|
||||
(us/verify ::us/uuid page-id)
|
||||
(ptk/reify ::go-to-page
|
||||
|
|
|
@ -86,22 +86,21 @@
|
|||
|
||||
(mf/defc workspace-page
|
||||
[{:keys [file layout page-id] :as props}]
|
||||
(let [page (mf/deref trimmed-page-ref)]
|
||||
(mf/use-layout-effect
|
||||
(mf/deps page-id)
|
||||
(mf/use-layout-effect
|
||||
(mf/deps page-id)
|
||||
(fn []
|
||||
(if (nil? page-id)
|
||||
(st/emit! (dw/go-to-page))
|
||||
(st/emit! (dw/initialize-page page-id)))
|
||||
|
||||
(fn []
|
||||
(if (nil? page-id)
|
||||
(st/emit! (dw/go-to-page))
|
||||
(st/emit! (dw/initialize-page page-id)))
|
||||
(when page-id
|
||||
(st/emit! (dw/finalize-page page-id))))))
|
||||
|
||||
(fn []
|
||||
(when page-id
|
||||
(st/emit! (dw/finalize-page page-id))))))
|
||||
|
||||
(when page
|
||||
[:& workspace-content {:key page-id
|
||||
:file file
|
||||
:layout layout}])))
|
||||
(when-let [page (mf/deref trimmed-page-ref)]
|
||||
[:& workspace-content {:key page-id
|
||||
:file file
|
||||
:layout layout}]))
|
||||
|
||||
(mf/defc workspace-loader
|
||||
[]
|
||||
|
|
Loading…
Add table
Reference in a new issue