diff --git a/apps/cyberstorm-remix/app/entry.server.tsx b/apps/cyberstorm-remix/app/entry.server.tsx index 79099f4a0..5c47abfc2 100644 --- a/apps/cyberstorm-remix/app/entry.server.tsx +++ b/apps/cyberstorm-remix/app/entry.server.tsx @@ -26,7 +26,7 @@ export default function handleRequest( remixContext: EntryContext, loadContext: AppLoadContext ) { - let prohibitOutOfOrderStreaming = + const prohibitOutOfOrderStreaming = isBotRequest(request.headers.get("user-agent")) || remixContext.isSpaMode; return prohibitOutOfOrderStreaming diff --git a/apps/cyberstorm-remix/app/root.tsx b/apps/cyberstorm-remix/app/root.tsx index 105587a17..6da9eef07 100644 --- a/apps/cyberstorm-remix/app/root.tsx +++ b/apps/cyberstorm-remix/app/root.tsx @@ -10,6 +10,7 @@ import { ScrollRestoration, isRouteErrorResponse, useLoaderData, + useLocation, useRouteError, } from "@remix-run/react"; // import { LinksFunction } from "@remix-run/react/dist/routeModules"; @@ -105,6 +106,9 @@ export async function clientLoader() { } // REMIX TODO: Do we want to force a hydration at the root level? +// Answer: Yes and no, without manual hydrating the header will not update +// to have the user stuff, since the initial data from server loader will be used +// until data changes or updates // clientLoader.hydrate = true; const adContainerIds = ["right-column-1", "right-column-2", "right-column-3"]; @@ -119,6 +123,9 @@ function Root() { currentUser: CurrentUser; } = JSON.parse(JSON.stringify(loaderOutput)); + const location = useLocation(); + const shouldShowAds = !location.pathname.startsWith("/teams"); + return ( @@ -149,9 +156,11 @@ function Root() {
- {adContainerIds.map((cid, k_i) => ( - - ))} + {shouldShowAds + ? adContainerIds.map((cid, k_i) => ( + + )) + : null}