mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
fix: handle back navigation from single file view to files list
This commit is contained in:
@@ -13,6 +13,13 @@ export function useAppGoBack(): () => void {
|
||||
return
|
||||
}
|
||||
|
||||
// For single file view, go back to files list
|
||||
if (pathname.match(/^\/sessions\/[^/]+\/file$/)) {
|
||||
const filesPath = pathname.replace(/\/file$/, '/files')
|
||||
navigate({ to: filesPath })
|
||||
return
|
||||
}
|
||||
|
||||
// For session routes, navigate to parent path
|
||||
if (pathname.startsWith('/sessions/')) {
|
||||
const parentPath = pathname.replace(/\/[^/]+$/, '') || '/sessions'
|
||||
|
||||
Reference in New Issue
Block a user