File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId]/chat/[chatId] Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Suspense } from 'react'
22import { dehydrate , HydrationBoundary } from '@tanstack/react-query'
33import type { Metadata } from 'next'
4+ import { notFound } from 'next/navigation'
45import { getSession } from '@/lib/auth'
6+ import { isChatEnabled } from '@/lib/core/config/env-flags'
57import { getQueryClient } from '@/app/_shell/providers/get-query-client'
68import { Home } from '@/app/workspace/[workspaceId]/home/home'
79import { HomeFallback } from '@/app/workspace/[workspaceId]/home/home-fallback'
@@ -20,6 +22,12 @@ interface ChatPageProps {
2022}
2123
2224export default async function ChatPage ( { params } : ChatPageProps ) {
25+ // The layout 404s too, but pages and layouts resolve concurrently — without this
26+ // the prefetch below still fires on its way out.
27+ if ( ! isChatEnabled ) {
28+ notFound ( )
29+ }
30+
2331 const [ { workspaceId, chatId } , session ] = await Promise . all ( [ params , getSession ( ) ] )
2432 const userId = session ?. user ?. id
2533 const queryClient = getQueryClient ( )
You can’t perform that action at this time.
0 commit comments