Skip to content

Commit a21c6d2

Browse files
committed
Nebula: Fix AutoConnect not using nebula client in root layout
1 parent c77b4d8 commit a21c6d2

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

apps/dashboard/src/app/(app)/account/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default async function AccountLayout(props: {
4646
/>
4747
{props.children}
4848
</div>
49-
<TWAutoConnect />
49+
<TWAutoConnect client={client} />
5050
<AppFooter />
5151
</div>
5252
);

apps/dashboard/src/app/(app)/components/autoconnect.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
"use client";
2-
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
2+
import type { ThirdwebClient } from "thirdweb";
33
import { AutoConnect } from "thirdweb/react";
44
import type { SmartWalletOptions } from "thirdweb/wallets";
55

6-
const client = getClientThirdwebClient();
7-
86
export function TWAutoConnect(props: {
97
accountAbstraction?: SmartWalletOptions;
8+
client: ThirdwebClient;
109
}) {
1110
return (
1211
<AutoConnect
13-
client={client}
12+
client={props.client}
1413
accountAbstraction={props.accountAbstraction}
1514
/>
1615
);

apps/dashboard/src/app/(app)/providers.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
import { TWAutoConnect } from "./components/autoconnect";
1919

2020
const queryClient = new QueryClient();
21+
const thirdwebClient = getClientThirdwebClient();
2122

2223
export function AppRouterProviders(props: { children: React.ReactNode }) {
2324
return (
@@ -26,7 +27,7 @@ export function AppRouterProviders(props: { children: React.ReactNode }) {
2627
<SyncChainStores />
2728
<ThirdwebProvider>
2829
<SyncChainDefinitionsToConnectionManager />
29-
<TWAutoConnect />
30+
<TWAutoConnect client={thirdwebClient} />
3031
<ThemeProvider
3132
attribute="class"
3233
disableTransitionOnChange

apps/dashboard/src/app/nebula-app/providers.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Toaster } from "sonner";
88
import { ThirdwebProvider, useActiveAccount } from "thirdweb/react";
99
import { TWAutoConnect } from "../(app)/components/autoconnect";
1010
import { NebulaConnectWallet } from "./(app)/components/NebulaConnectButton";
11+
import { nebulaAppThirdwebClient } from "./(app)/utils/nebulaThirdwebClient";
1112
import { nebulaAAOptions } from "./login/account-abstraction";
1213

1314
const queryClient = new QueryClient();
@@ -16,7 +17,10 @@ export function NebulaProviders(props: { children: React.ReactNode }) {
1617
return (
1718
<QueryClientProvider client={queryClient}>
1819
<ThirdwebProvider>
19-
<TWAutoConnect accountAbstraction={nebulaAAOptions} />
20+
<TWAutoConnect
21+
accountAbstraction={nebulaAAOptions}
22+
client={nebulaAppThirdwebClient}
23+
/>
2024
<ThemeProvider
2125
attribute="class"
2226
disableTransitionOnChange

0 commit comments

Comments
 (0)