mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-07 06:52:28 +00:00
refactor(web): unify session creation into single page with path history
This commit is contained in:
@@ -8,17 +8,12 @@ export function useAppGoBack(): () => void {
|
||||
|
||||
return useCallback(() => {
|
||||
// Use explicit path navigation for consistent behavior across all environments
|
||||
if (pathname.startsWith('/sessions/')) {
|
||||
if (pathname === '/sessions/new') {
|
||||
navigate({ to: '/sessions' })
|
||||
return
|
||||
}
|
||||
|
||||
if (pathname.endsWith('/spawn')) {
|
||||
navigate({ to: '/machines' })
|
||||
return
|
||||
}
|
||||
|
||||
if (pathname.startsWith('/machines')) {
|
||||
if (pathname.startsWith('/sessions/')) {
|
||||
navigate({ to: '/sessions' })
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user