fix(workspace): handleBack pasa ?org=orgId para scroll contextual en biblioteca
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -192,8 +192,10 @@ export function WorkspacePage() {
|
||||
: currentProcess.orgName ?? 'Biblioteca'
|
||||
|
||||
function handleBack() {
|
||||
// Navega siempre a /library (sin ?org=) hasta que exista una vista filtrada por org
|
||||
void navigate({ to: '/library' })
|
||||
void navigate({
|
||||
to: '/library',
|
||||
search: { org: currentProcess?.orgId ?? undefined },
|
||||
})
|
||||
}
|
||||
|
||||
// Label del tab "elemento" según lo seleccionado
|
||||
|
||||
@@ -107,6 +107,9 @@ const libraryRoute = createRoute({
|
||||
getParentRoute: () => rootRoute,
|
||||
path: '/library',
|
||||
component: LibraryPage,
|
||||
validateSearch: (search: Record<string, unknown>) => ({
|
||||
org: typeof search.org === 'string' ? search.org : undefined,
|
||||
}),
|
||||
})
|
||||
|
||||
const importRoute = createRoute({
|
||||
@@ -134,7 +137,7 @@ const settingsRoute = createRoute({
|
||||
beforeLoad: ({ context }) => {
|
||||
const role = (context as { auth?: { user?: { platformRole?: string } } }).auth?.user?.platformRole
|
||||
if (role === 'client_editor' || role === 'client_viewer') {
|
||||
throw redirect({ to: '/library' })
|
||||
throw redirect({ to: '/library', search: { org: undefined } })
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user