Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Use pathname ref in EventRouter bootstrap navigation

Julius Marminge69a2eac2ff1b
diff --git a/apps/web/src/routes/__root.tsx b/apps/web/src/routes/__root.tsx
index b21389e3d..a7fbeb339 100644
--- a/apps/web/src/routes/__root.tsx
+++ b/apps/web/src/routes/__root.tsx
@@ -127,8 +127,10 @@ function EventRouter() {
const queryClient = useQueryClient();
const navigate = useNavigate();
const pathname = useRouterState({ select: (state) => state.location.pathname });
+ const pathnameRef = useRef(pathname);
const lastConfigIssuesSignatureRef = useRef<string | null>(null);
const handledBootstrapThreadIdRef = useRef<string | null>(null);
+ pathnameRef.current = pathname;
useEffect(() => {
const api = readNativeApi();
@@ -201,7 +203,7 @@ function EventRouter() {
projectId: payload.bootstrapProjectId,
expanded: true,
});
- if (pathname !== "/") {
+ if (pathnameRef.current !== "/") {
return;
}
if (handledBootstrapThreadIdRef.current === payload.bootstrapThreadId) {
@@ -264,7 +266,7 @@ function EventRouter() {
unsubWelcome();
unsubServerConfigUpdated();
};
- }, [dispatch, navigate, pathname, queryClient]);
+ }, [dispatch, navigate, queryClient]);
return null;
}