diff --git a/packages/app/src/app/h/[serverId]/index.tsx b/packages/app/src/app/h/[serverId]/index.tsx index 550bbc171..0f6b8c509 100644 --- a/packages/app/src/app/h/[serverId]/index.tsx +++ b/packages/app/src/app/h/[serverId]/index.tsx @@ -14,13 +14,6 @@ import { prepareWorkspaceTab } from "@/utils/workspace-navigation"; const HOST_ROOT_REDIRECT_DELAY_MS = 300; -function getCurrentPathname(fallbackPathname: string): string { - if (typeof window === "undefined") { - return fallbackPathname; - } - return window.location.pathname || fallbackPathname; -} - export default function HostIndexRoute() { return ( @@ -50,13 +43,11 @@ function HostIndexRouteContent() { return; } const rootRoute = buildHostRootRoute(serverId); - const currentPathname = getCurrentPathname(pathname); - if (currentPathname !== rootRoute && currentPathname !== `${rootRoute}/`) { + if (pathname !== rootRoute && pathname !== `${rootRoute}/`) { return; } const timer = setTimeout(() => { - const latestPathname = getCurrentPathname(pathname); - if (latestPathname !== rootRoute && latestPathname !== `${rootRoute}/`) { + if (pathname !== rootRoute && pathname !== `${rootRoute}/`) { return; }