mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-07 06:52:28 +00:00
fix: navigate to parent path generically in useAppGoBack instead of hardcoded /sessions
This commit is contained in:
@@ -13,8 +13,10 @@ export function useAppGoBack(): () => void {
|
||||
return
|
||||
}
|
||||
|
||||
// For session routes, navigate to parent path
|
||||
if (pathname.startsWith('/sessions/')) {
|
||||
navigate({ to: '/sessions' })
|
||||
const parentPath = pathname.replace(/\/[^/]+$/, '') || '/sessions'
|
||||
navigate({ to: parentPath })
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user