File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ function RequireAuth({ children }: { children: React.ReactNode }) {
8282
8383 if ( loading && ! user ) {
8484 return (
85- < div className = "flex min-h-screen items-center justify-center bg-background" >
85+ < div className = "flex min-h-screen w-full flex-1 items-center justify-center bg-background" >
8686 < div className = "h-8 w-8 animate-spin rounded-full border-4 border-muted border-t-primary" />
8787 </ div >
8888 ) ;
@@ -107,6 +107,12 @@ function RequireAuth({ children }: { children: React.ReactNode }) {
107107 return < > { children } </ > ;
108108}
109109
110+ function AuthedAiChatPanel ( ) {
111+ const { user } = useSession ( ) ;
112+ if ( ! user ) return null ;
113+ return < AiChatPanel /> ;
114+ }
115+
110116function RootComponent ( ) {
111117 const client = useObjectStackClient ( ) ;
112118
@@ -132,7 +138,7 @@ function RootComponent() {
132138 < Outlet />
133139 </ RequireAuth >
134140 < Toaster />
135- < AiChatPanel />
141+ < AuthedAiChatPanel />
136142 </ ProductionGuardProvider >
137143 </ SidebarProvider >
138144 </ ErrorBoundary >
You can’t perform that action at this time.
0 commit comments