- Wait for the legacy shell bridge/profile before React routes render - Expose the shell bridge and profile through root TanStack context - Update issue routes and shell helpers to consume the shared context - Remove the redundant issues search normalization on read - Refresh the affected tests around shell bootstrap and routing
19 lines
579 B
TypeScript
19 lines
579 B
TypeScript
import { createFileRoute, redirect } from '@tanstack/react-router';
|
|
|
|
import { getProfileHomePath } from '@/platform/shell/bridge';
|
|
import { LegacyRouteController } from '@/platform/shell/route-controllers';
|
|
|
|
export const Route = createFileRoute('/')({
|
|
beforeLoad: ({ context, location }) => {
|
|
if (location.pathname !== '/') return;
|
|
|
|
const { bridge } = context.shell;
|
|
|
|
throw redirect({ href: getProfileHomePath(bridge), replace: true });
|
|
},
|
|
component: IndexRouteComponent,
|
|
});
|
|
|
|
function IndexRouteComponent() {
|
|
return <LegacyRouteController pathname="/" />;
|
|
}
|