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'
|
: currentProcess.orgName ?? 'Biblioteca'
|
||||||
|
|
||||||
function handleBack() {
|
function handleBack() {
|
||||||
// Navega siempre a /library (sin ?org=) hasta que exista una vista filtrada por org
|
void navigate({
|
||||||
void navigate({ to: '/library' })
|
to: '/library',
|
||||||
|
search: { org: currentProcess?.orgId ?? undefined },
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Label del tab "elemento" según lo seleccionado
|
// Label del tab "elemento" según lo seleccionado
|
||||||
|
|||||||
@@ -107,6 +107,9 @@ const libraryRoute = createRoute({
|
|||||||
getParentRoute: () => rootRoute,
|
getParentRoute: () => rootRoute,
|
||||||
path: '/library',
|
path: '/library',
|
||||||
component: LibraryPage,
|
component: LibraryPage,
|
||||||
|
validateSearch: (search: Record<string, unknown>) => ({
|
||||||
|
org: typeof search.org === 'string' ? search.org : undefined,
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
const importRoute = createRoute({
|
const importRoute = createRoute({
|
||||||
@@ -134,7 +137,7 @@ const settingsRoute = createRoute({
|
|||||||
beforeLoad: ({ context }) => {
|
beforeLoad: ({ context }) => {
|
||||||
const role = (context as { auth?: { user?: { platformRole?: string } } }).auth?.user?.platformRole
|
const role = (context as { auth?: { user?: { platformRole?: string } } }).auth?.user?.platformRole
|
||||||
if (role === 'client_editor' || role === 'client_viewer') {
|
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