diff --git a/apps/web/src/routes/__root.tsx b/apps/web/src/routes/__root.tsx
index ec525fa231..7ac3416b9b 100644
--- a/apps/web/src/routes/__root.tsx
+++ b/apps/web/src/routes/__root.tsx
@@ -99,19 +99,20 @@ export const Route = createRootRouteWithContext<{
}),
});
+const APP_SHELL = (
+
+
+
+
+
+);
+
function RootRouteView() {
const pathname = useLocation({ select: (location) => location.pathname });
const { authGateState } = Route.useRouteContext();
const primaryEnvironmentAuthenticated = authGateState.status === "authenticated";
- useEffect(() => {
- const frame = window.requestAnimationFrame(() => {
- syncBrowserChromeTheme();
- });
- return () => {
- window.cancelAnimationFrame(frame);
- };
- }, [pathname]);
+ useBrowserChromeThemeSync(pathname);
if (pathname === "/pair") {
return ;
@@ -121,14 +122,6 @@ function RootRouteView() {
return ;
}
- const appShell = (
-
-
-
-
-
- );
-
return (
@@ -142,15 +135,26 @@ function RootRouteView() {
{primaryEnvironmentAuthenticated ? : null}
{primaryEnvironmentAuthenticated ? : null}
{primaryEnvironmentAuthenticated ? (
- {appShell}
+ {APP_SHELL}
) : (
- appShell
+ APP_SHELL
)}
);
}
+function useBrowserChromeThemeSync(pathname: string) {
+ useEffect(() => {
+ const frame = window.requestAnimationFrame(() => {
+ syncBrowserChromeTheme();
+ });
+ return () => {
+ window.cancelAnimationFrame(frame);
+ };
+ }, [pathname]);
+}
+
function HostedStaticEnvironmentBootstrap() {
const savedEnvironmentCount = useSavedEnvironmentRegistryStore(
(state) => Object.keys(state.byId).length,