mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 09:06:38 +02: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.
|
becomes inactive.
|
||||||
|
|
||||||
### :bug: Bugs fixed
|
### :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
|
### :arrow_up: Deps updates
|
||||||
### :boom: Breaking changes
|
### :boom: Breaking changes
|
||||||
### :heart: Community contributions by (Thank you!)
|
### :heart: Community contributions by (Thank you!)
|
||||||
|
|
|
@ -214,8 +214,6 @@
|
||||||
(rx/of (dwn/finalize file-id)
|
(rx/of (dwn/finalize file-id)
|
||||||
::dwp/finalize))))
|
::dwp/finalize))))
|
||||||
|
|
||||||
(declare go-to-page)
|
|
||||||
|
|
||||||
(defn initialize-page
|
(defn initialize-page
|
||||||
[page-id]
|
[page-id]
|
||||||
(us/assert ::us/uuid page-id)
|
(us/assert ::us/uuid page-id)
|
||||||
|
@ -1193,7 +1191,6 @@
|
||||||
|
|
||||||
(defn go-to-page
|
(defn go-to-page
|
||||||
([]
|
([]
|
||||||
|
|
||||||
(ptk/reify ::go-to-page
|
(ptk/reify ::go-to-page
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [it state stream]
|
(watch [it state stream]
|
||||||
|
@ -1203,7 +1200,7 @@
|
||||||
|
|
||||||
pparams {:file-id file-id :project-id project-id}
|
pparams {:file-id file-id :project-id project-id}
|
||||||
qparams {:page-id page-id}]
|
qparams {:page-id page-id}]
|
||||||
(rx/of (rt/nav :workspace pparams qparams))))))
|
(rx/of (rt/nav' :workspace pparams qparams))))))
|
||||||
([page-id]
|
([page-id]
|
||||||
(us/verify ::us/uuid page-id)
|
(us/verify ::us/uuid page-id)
|
||||||
(ptk/reify ::go-to-page
|
(ptk/reify ::go-to-page
|
||||||
|
|
|
@ -86,22 +86,21 @@
|
||||||
|
|
||||||
(mf/defc workspace-page
|
(mf/defc workspace-page
|
||||||
[{:keys [file layout page-id] :as props}]
|
[{:keys [file layout page-id] :as props}]
|
||||||
(let [page (mf/deref trimmed-page-ref)]
|
(mf/use-layout-effect
|
||||||
(mf/use-layout-effect
|
(mf/deps page-id)
|
||||||
(mf/deps page-id)
|
(fn []
|
||||||
|
(if (nil? page-id)
|
||||||
|
(st/emit! (dw/go-to-page))
|
||||||
|
(st/emit! (dw/initialize-page page-id)))
|
||||||
|
|
||||||
(fn []
|
(fn []
|
||||||
(if (nil? page-id)
|
(when page-id
|
||||||
(st/emit! (dw/go-to-page))
|
(st/emit! (dw/finalize-page page-id))))))
|
||||||
(st/emit! (dw/initialize-page page-id)))
|
|
||||||
|
|
||||||
(fn []
|
(when-let [page (mf/deref trimmed-page-ref)]
|
||||||
(when page-id
|
[:& workspace-content {:key page-id
|
||||||
(st/emit! (dw/finalize-page page-id))))))
|
:file file
|
||||||
|
:layout layout}]))
|
||||||
(when page
|
|
||||||
[:& workspace-content {:key page-id
|
|
||||||
:file file
|
|
||||||
:layout layout}])))
|
|
||||||
|
|
||||||
(mf/defc workspace-loader
|
(mf/defc workspace-loader
|
||||||
[]
|
[]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue