mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
set location to /
if cannot back
This commit is contained in:
parent
7236235ad2
commit
3713083a94
@ -176,7 +176,14 @@ export const PageRender = React.memo((props) => {
|
||||
}
|
||||
|
||||
app.backLocation = (state = {}) => {
|
||||
return navigate(app.location.lastPathname, {
|
||||
let to = app.location.lastPathname
|
||||
|
||||
if (!to || to === app.location.pathname) {
|
||||
console.warn("No last location found, redirecting to /")
|
||||
to = "/"
|
||||
}
|
||||
|
||||
return navigate(to, {
|
||||
state
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user