@@ -60,7 +60,11 @@ interface WorkspaceContentProps {
6060 session : NonNullable < Awaited < ReturnType < typeof getSession > > >
6161 queryClient : QueryClient
6262 hostContext : WorkspaceHostContext
63- initialOrgSettings : OrganizationWhitelabelSettings | null
63+ orgSettings : Promise < OrganizationWhitelabelSettings | null >
64+ }
65+
66+ interface WorkspaceLoadingProps {
67+ orgSettings : Promise < OrganizationWhitelabelSettings | null >
6468}
6569
6670export default async function WorkspaceLayout ( { children, params } : WorkspaceLayoutProps ) {
@@ -76,33 +80,37 @@ export default async function WorkspaceLayout({ children, params }: WorkspaceLay
7680 return < WorkspaceAccessDenied />
7781 }
7882
79- const initialOrgSettings = hostContext . hostOrganizationId
80- ? await getOrgWhitelabelSettings ( hostContext . hostOrganizationId )
81- : null
82- const brand = mergeOrgBrandConfig ( initialOrgSettings , getBrandConfig ( ) )
83+ const orgSettings = hostContext . hostOrganizationId
84+ ? getOrgWhitelabelSettings ( hostContext . hostOrganizationId )
85+ : Promise . resolve ( null )
8386
8487 return (
85- < Suspense fallback = { < ApplicationLoading brand = { brand } /> } >
88+ < Suspense fallback = { < WorkspaceLoading orgSettings = { orgSettings } /> } >
8689 < WorkspaceContent
8790 workspaceId = { workspaceId }
8891 session = { session }
8992 queryClient = { queryClient }
9093 hostContext = { hostContext }
91- initialOrgSettings = { initialOrgSettings }
94+ orgSettings = { orgSettings }
9295 >
9396 { children }
9497 </ WorkspaceContent >
9598 </ Suspense >
9699 )
97100}
98101
102+ async function WorkspaceLoading ( { orgSettings } : WorkspaceLoadingProps ) {
103+ const brand = mergeOrgBrandConfig ( await orgSettings , getBrandConfig ( ) )
104+ return < ApplicationLoading brand = { brand } />
105+ }
106+
99107async function WorkspaceContent ( {
100108 children,
101109 workspaceId,
102110 session,
103111 queryClient,
104112 hostContext,
105- initialOrgSettings ,
113+ orgSettings ,
106114} : WorkspaceContentProps ) {
107115 const activeOrganizationId = getActiveOrganizationId ( session )
108116 const principal = {
@@ -112,6 +120,7 @@ async function WorkspaceContent({
112120 } as const
113121 const [
114122 cookieStore ,
123+ initialOrgSettings ,
115124 ,
116125 modelSelectorEnabled ,
117126 planModeEnabled ,
@@ -122,6 +131,7 @@ async function WorkspaceContent({
122131 desktopExecutorRegistered ,
123132 ] = await Promise . all ( [
124133 cookies ( ) ,
134+ orgSettings ,
125135 prefetchWorkspaceSidebar (
126136 queryClient ,
127137 workspaceId ,
0 commit comments