fix: navigate to parent path generically in useAppGoBack instead of hardcoded /sessions

This commit is contained in:
weishu
2025-12-24 16:26:20 +08:00
parent a2edd88d93
commit 9b9f792ff6
+3 -1
View File
@@ -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
}