Skip to content

Commit 42ef960

Browse files
committed
Fixing global commands provider hierarchy
1 parent 413208e commit 42ef960

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

apps/web/app/(v1)/GlobalCommandBarProvider.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export function useCommandDefinitionMap() {
7272
const allCommands: CommandDefinitionMap = {
7373
...navCommands,
7474
...orgCommands,
75-
// Add any other global commands here
7675
...useConnectionCommands(),
7776
}
7877
return allCommands

apps/web/app/(v1)/console/(authenticated)/layout.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,28 @@ import {AppLayout} from '@openint/ui-v1'
44
import {OrganizationSwitcher, UserButton} from '@/lib-client/auth.client'
55
import {currentViewer} from '@/lib-server/auth.server'
66
import {GlobalCommandBarProvider} from '../../GlobalCommandBarProvider'
7+
import {ClientApp} from './client'
78

89
export default async function AuthenticatedLayout({
910
children,
1011
}: {
1112
children: React.ReactNode
1213
}) {
13-
const {viewer} = await currentViewer()
14+
const {viewer, token = ''} = await currentViewer()
1415
console.log('AuthenticatedLayout viewer', viewer)
1516
if (viewer.role !== 'user') {
1617
return redirect('/console/sign-in')
1718
}
1819

1920
return (
20-
<GlobalCommandBarProvider>
21-
<AppLayout
22-
organizationSwitcher={<OrganizationSwitcher />}
23-
userButton={<UserButton showName />}>
24-
{children}
25-
</AppLayout>
26-
</GlobalCommandBarProvider>
21+
<ClientApp token={token}>
22+
<GlobalCommandBarProvider>
23+
<AppLayout
24+
organizationSwitcher={<OrganizationSwitcher />}
25+
userButton={<UserButton showName />}>
26+
{children}
27+
</AppLayout>
28+
</GlobalCommandBarProvider>
29+
</ClientApp>
2730
)
2831
}

apps/web/app/(v1)/console/(authenticated)/page.tsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,19 @@ export default async function Page(props: PageProps) {
8080
<pre>
8181
<code>{JSON.stringify(viewer, null, 2)}</code>
8282
</pre>
83-
<ClientApp token={token}>
84-
<h1>AddConnection</h1>
85-
<Suspense fallback={<Fallback />}>
86-
<AddConnection
87-
initialData={withRandomDelay(api.listConnectorConfigs())}
88-
/>
89-
</Suspense>
90-
91-
<h1>ConnectionList</h1>
92-
93-
<Suspense fallback={<Fallback />}>
94-
<ConnectionList
95-
initialData={withRandomDelay(api.listConnections())}
96-
/>
97-
</Suspense>
98-
</ClientApp>
83+
84+
<h1>AddConnection</h1>
85+
<Suspense fallback={<Fallback />}>
86+
<AddConnection
87+
initialData={withRandomDelay(api.listConnectorConfigs())}
88+
/>
89+
</Suspense>
90+
91+
<h1>ConnectionList</h1>
92+
93+
<Suspense fallback={<Fallback />}>
94+
<ConnectionList initialData={withRandomDelay(api.listConnections())} />
95+
</Suspense>
9996

10097
<hr />
10198
<hr />

0 commit comments

Comments
 (0)